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
Name | Data Type | Description |
---|---|---|
p_user | VARCHAR(32) | The name of the account to be created. |
p_host | VARCHAR(20) | The host range that can access the account. |
p_pwd | VARCHAR(250) | The password for the new account. |
How to use
CALL mysql.mnms_create_user('UserName','%','test');
Example
-
Account Creation
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
Name | Data Type | Description |
---|---|---|
p_user | VARCHAR(32) | The name of the account to be deleted. |
p_host | VARCHAR(20) | The host range of the account to be deleted. |
How to use
CALL mysql.mnms_drop_user('UserName', '%');
Example
-
Account Deletion
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
Name | Data Type | Description |
---|---|---|
p_value | VARCHAR(20) | The name of the user account to grant permissions to. |
p_host | VARCHAR(20) | The host range for the user account. |
p_right | VARCHAR(8000) | The permissions to be granted to the account. |
p_target_db | VARCHAR(250) | The target database for the permissions. |
p_target_schema | VARCHAR(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
-
Granting Permissions
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
Name | Data Type | Description |
---|---|---|
p_user | VARCHAR(32) | The name of the user account to revoke permissions from. |
p_host | VARCHAR(20) | The host range for the user account. |
p_right | VARCHAR(8000) | The permissions to be revoked. |
p_target_db | VARCHAR(250) | The target database from which to revoke permissions. |
p_target_schema | VARCHAR(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
-
Revoking Permissions
caution
Permissions cannot be revoked from system accounts.