---
title: godo.Databases.UpdateUser()
description: UpdateUser will update an existing database user
product: Reference
url: https://docs.digitalocean.com/reference/godo/reference/databases/databases-update-user/
last_updated: "2026-11-05"
---

> **For AI agents:** The documentation index is at [https://docs.digitalocean.com/llms.txt](https://docs.digitalocean.com/llms.txt). Markdown versions of pages use the same URL with `index.html.md` in place of the HTML page (for example, append `index.html.md` to the directory path instead of opening the HTML document).

# godo.Databases.UpdateUser()

Generated on 5 Nov 2026 from godo version [`v1.236.0`](https://github.com/digitalocean/godo/releases/tag/v1.236.0)

## Usage

```go
client.Databases.UpdateUser(ctx context.Context, databaseID string, userID string, updateUser *godo.DatabaseUpdateUserRequest) (*godo.DatabaseUser, *godo.Response, error)
```

## Description

`UpdateUser` will update an existing database user

This method sends a PUT request to [`/v2/databases/{}/users/{}`](https://docs.digitalocean.com/reference/api/reference/databases/index.html.md#databases_update_user).

## Parameters

`databaseID` string required

`userID` string required

`updateUser` \*godo.DatabaseUpdateUserRequest required

### Fields of `godo.DatabaseUpdateUserRequest`

`DatabaseUpdateUserRequest` is used to update an existing database user

`Settings` \*godo.DatabaseUserSettings

Omitted from JSON when empty. JSON key: `settings`

## Returns

\*godo.DatabaseUser

\*godo.Response

The HTTP response, with pagination `Links`, `Meta`, and `Rate` limit information.

error

Non-nil when the request fails. API errors are returned as `*godo.ErrorResponse`.

### Fields of `godo.DatabaseUser`

`DatabaseUser` represents a user in the database

`Name` string

Omitted from JSON when empty. JSON key: `name`

`Role` string

Omitted from JSON when empty. JSON key: `role`

`Password` string

Omitted from JSON when empty. JSON key: `password`

`AccessCert` string

Omitted from JSON when empty. JSON key: `access_cert`

`AccessKey` string

Omitted from JSON when empty. JSON key: `access_key`

`MySQLSettings` \*godo.DatabaseMySQLUserSettings

Omitted from JSON when empty. JSON key: `mysql_settings`

`Settings` \*godo.DatabaseUserSettings

Omitted from JSON when empty. JSON key: `settings`

## Request Sample

## Show Request Sample

```go
package main

import (
	"context"
	"fmt"
	"log"
	"os"

	"github.com/digitalocean/godo"
)

func main() {
	client := godo.NewFromToken(os.Getenv("DIGITALOCEAN_TOKEN"))
	ctx := context.TODO()

	result, _, err := client.Databases.UpdateUser(ctx, "<your-database-id>", "<your-user-id>", &godo.DatabaseUpdateUserRequest{})
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", result)
}
```

## Response Example

## Show Response Example

```json
{
  "user": {
    "name": "app-01",
    "role": "normal",
    "password": "example_password"
  }
}
```

## More Information

See [`PUT /v2/databases/{}/users/{}`](https://docs.digitalocean.com/reference/api/reference/databases/index.html.md#databases_update_user) in the API reference for additional detail on responses, headers, parameters, and more.

See the [Go package documentation](https://pkg.go.dev/github.com/digitalocean/godo#DatabasesServiceOp.UpdateUser) for the source of this method.