SingleStore Managed Service

Manage Database Users

Notice

You must connect to the Admin endpoint to run the following commands.

Add a Database User

Use the GRANT command to add a database user.

GRANT <grant_options> TO '<user>'@'<host>' IDENTIFIED BY '<password>'

For example:

GRANT SELECT, INSERT ON db.* TO 'username'@'%' IDENTIFIED BY 'password'

Refer to GRANT for more information.

Change a Database User Password

The database admin password is configured when the cluster is first created. This is also referred to as the “Master Username” in the portal, which is admin by default.

To change this password, navigate to the cluster name in the left nav > Cluster Overview > User Access. Click the Reset button next to the Password field and follow the provided instructions.

Note: You must have SUPER privileges to change another user’s password using the GRANT command.

Use the SET PASSWORD command to change a database user's password. A database user can also use this command to change their own password.

SET PASSWORD FOR 'username'@'host' = PASSWORD('password');

Remove a Database User

To remove a database user, use the DROP USER command.

DROP USER '<user>'@'<host>'

Inspect Database User Permissions

You can view grants and permissions by querying information_schema.user_privileges.

You can also view grants for a user by running SHOW GRANTS:

SHOW GRANTS FOR user@domain;