Skip to main content

Account Creation and Permissions

You can manage accounts and permissions in KakaoCloud MySQL using the built-in stored procedures.

Account creation procedure

This procedure is used to create accounts beyond those created through the console.

Procedure name

mnms_create_user

Procedure parameters

NameData TypeDescription
p_userVARCHAR(32)The name of the account to be created.
p_hostVARCHAR(20)The host range that can access the account.
p_pwdVARCHAR(250)The password for the new account.

How to use

CALL mysql.mnms_create_user('UserName','%','test');

Example

  1. Account Creation

    Image

caution

You cannot create an account with the same name as a system account.

Account deletion procedure

This procedure is used to delete accounts created by users (not via the console).

Procedure name

mnms_drop_user

Procedure parameters

NameData TypeDescription
p_userVARCHAR(32)The name of the account to be deleted.
p_hostVARCHAR(20)The host range of the account to be deleted.

How to use

CALL mysql.mnms_drop_user('UserName', '%');

Example

  1. Account Deletion

    Image

caution

You cannot delete system accounts.

Grant permissions procedure

This procedure grants necessary permissions to user-created accounts.

Procedure name

mnms_grant_right_user

Procedure parameters

NameData TypeDescription
p_valueVARCHAR(20)The name of the user account to grant permissions to.
p_hostVARCHAR(20)The host range for the user account.
p_rightVARCHAR(8000)The permissions to be granted to the account.
p_target_dbVARCHAR(250)The target database for the permissions.
p_target_schemaVARCHAR(250)The target object within the database.

How to use

CALL mysql.mnms_grant_right_user('UserName', '%', 'ALTER, CREATE, DELETE, DROP, EXECUTE, INSERT, SELECT, UPDATE', '*', '*');

Example

  1. Granting Permissions

    Image

caution

Permissions cannot be granted to system accounts.

Revoke permissions procedure

This procedure revokes permissions from user-created accounts.

Procedure name

mnms_revoke_right_user

Procedure parameters

NameData TypeDescription
p_userVARCHAR(32)The name of the user account to revoke permissions from.
p_hostVARCHAR(20)The host range for the user account.
p_rightVARCHAR(8000)The permissions to be revoked.
p_target_dbVARCHAR(250)The target database from which to revoke permissions.
p_target_schemaVARCHAR(250)The target object within the database.

How to use

CALL mysql.mnms_revoke_right_user('UserName', '%', 'ALTER, CREATE, DELETE, DROP, EXECUTE, INSERT, SELECT, UPDATE', '*', '*');

Example

  1. Revoking Permissions

    Image

caution

Permissions cannot be revoked from system accounts.