2023-10-12 04:32:49 -07:00
|
|
|
# doctl databases user
|
|
|
|
|
|
|
|
> View details for, and create, database users.
|
|
|
|
> More information: <https://docs.digitalocean.com/reference/doctl/reference/databases/user>.
|
|
|
|
|
|
|
|
- Run a `doctl databases user` command with an access token:
|
|
|
|
|
2025-05-11 17:01:39 +03:00
|
|
|
`doctl {{[d|databases]}} {{[u|user]}} {{command}} {{[-t|--access-token]}} {{access_token}}`
|
2023-10-12 04:32:49 -07:00
|
|
|
|
|
|
|
- Retrieve details about a database user:
|
|
|
|
|
2025-05-11 17:01:39 +03:00
|
|
|
`doctl {{[d|databases]}} {{[u|user]}} {{[g|get]}} {{database_id}} {{user_name}}`
|
2023-10-12 04:32:49 -07:00
|
|
|
|
|
|
|
- Retrieve a list of database users for a given database:
|
|
|
|
|
2025-05-11 17:01:39 +03:00
|
|
|
`doctl {{[d|databases]}} {{[u|user]}} {{[ls|list]}} {{database_id}}`
|
2023-10-12 04:32:49 -07:00
|
|
|
|
|
|
|
- Reset the auth password for a given user:
|
|
|
|
|
2025-05-11 17:01:39 +03:00
|
|
|
`doctl {{[d|databases]}} {{[u|user]}} {{[rs|reset]}} {{database id}} {{user_name}}`
|
2023-10-12 04:32:49 -07:00
|
|
|
|
|
|
|
- Reset the MySQL auth plugn for a given user:
|
|
|
|
|
2025-05-11 17:01:39 +03:00
|
|
|
`doctl {{[d|databases]}} {{[u|user]}} {{[rs|reset]}} {{database_id}} {{user_name}} {{caching_sha2_password|mysql_native_password}}`
|
2023-10-12 04:32:49 -07:00
|
|
|
|
|
|
|
- Create a user in the given database with a given username:
|
|
|
|
|
2025-05-11 17:01:39 +03:00
|
|
|
`doctl {{[d|databases]}} {{[u|user]}} {{[c|create]}} {{database_id}} {{user_name}}`
|
2023-10-12 04:32:49 -07:00
|
|
|
|
|
|
|
- Delete a user from the given database with the given username:
|
|
|
|
|
2025-05-11 17:01:39 +03:00
|
|
|
`doctl {{[d|databases]}} {{[u|user]}} {{[rm|delete]}} {{database_id}} {{user_name}}`
|