Managing database users

You can add and remove users, as well as manage their individual settings.

Getting a list of users

  1. Go to the folder page and select Managed Service for MySQL.
  2. Click on the name of the cluster you need and then select the Users tab.

If you don't have the Yandex.Cloud command line interface yet, install it.

The folder specified in the CLI profile is used by default. You can specify a different folder using the --folder-name or --folder-id parameter.

To get a list of cluster users, run the command:

$ yc managed-mysql user list
     --cluster-name=<cluster name>

The cluster name can be requested with a list of clusters in the folder.

Add a user

Note

Assign roles to users via the management console or API. Roles assigned by the GRANT database command will be reset on making changes via the management console or API.

  1. Go to the folder page and select Managed Service for MySQL.
  2. Click on the name of the cluster you need and select the tab Users.
  3. Click Add.
  4. Enter the database username and password (from 8 to 128 characters).
  5. Select the database to grant the user access to.
  6. Select the user role and click Add under the list of roles. Repeat the action for all the roles that the user needs.
  7. Click Add in the new user window.

If you don't have the Yandex.Cloud command line interface yet, install it.

The folder specified in the CLI profile is used by default. You can specify a different folder using the --folder-name or --folder-id parameter.

To create a user in a cluster, run the command:

$ yc managed-mysql user create <username>
     --cluster-name=<cluster name>
     --password=<DB user password>
     --permissions=<list of DBs the user will get access to>

The cluster name can be requested with a list of clusters in the folder.

Changing users

For the user, you can change:

  • Name and password.
  • List of databases the user can access.
  • Limitation on the number of DB connections.

In the management console, you can only change the password of a database user:

  1. Go to the folder page and select Managed Service for MySQL.
  2. Click on the name of the cluster you need and select the tab Users.
  3. Click image and select Change password.

If you don't have the Yandex.Cloud command line interface yet, install it.

The folder specified in the CLI profile is used by default. You can specify a different folder using the --folder-name or --folder-id parameter.

To change the user's password or the list of databases available to the user, run:

$ yc managed-mysql user update <username>
     --cluster-name=<cluster name>
     --password=<DB user password>
     --permissions=<list of DBs the user can access>

The cluster name can be requested with a list of clusters in the folder.

Deleting users

  1. Go to the folder page and select Managed Service for MySQL.
  2. Click on the name of the cluster you need and select the tab Users.
  3. Click image and select Delete.

If you don't have the Yandex.Cloud command line interface yet, install it.

The folder specified in the CLI profile is used by default. You can specify a different folder using the --folder-name or --folder-id parameter.

To remove a user, run:

$ yc managed-mysql user delete <username>
     --cluster-name=<cluster name>

The cluster name can be requested with a list of clusters in the folder.