--- title: "Create DB and manage accounts through MySQL stored procedure" slug: "hadoop-vpc-13" tags: ["VPC", "Cloud Hadoop", "MySQL"] updated: 2026-09-17T09:17:45Z published: 2026-09-17T09:17:45Z canonical: "guide.ncloud-docs.com/hadoop-vpc-13" stale: true --- > ## Documentation Index > Fetch the complete documentation index at: https://guide.ncloud-docs.com/llms.txt > Use this file to discover all available pages before exploring further. # Create DB and manage accounts through MySQL stored procedure Available in VPC MySQL Stored Procedure organizes SQL syntaxes that perform a series of procedures so they can be run in `CALL function();` format. MySQL Stored Procedure provides 4 features: creating user accounts, creating new databases, changing the password, and viewing the list of accounts created. ## Access MySQL DB To run MySQL Stored Procedure, you must access MySQL DB after accessing the cluster server where the database is installed. To access MySQL DB: 1. Access the cluster server through SSH directly. ``` $ mysql -h mysql.local -u [admin account] -p Enter password: Password ``` - For more information, see [Access a cluster node with SSH](/docs/en/hadoop-vpc-5). 1. Run the following commands to access MySQL DB. - Connect to the master node via SSH and execute the command. - Enter the cluster administrator account information in `[관리자 계정]` and execute the command. When `Enter password:` appears, enter the account password. ## How to use Stored procedure ### Check the procedure creation To view the created procedure: 1. Among the DB lists that are output after you run the `show databases;` commands, access Ambari DB with the following commands: ``` use ambari_{unique number}; ``` - Enter the name of the database you want to access in the ambari_{unique number} location. 2. Run the `SHOW PROCEDURE STATUS WHERE DB = 'ambari_{`unique number`}';` commands and check the 4 procedures created in Ambari DB. - Currently available procedures: CHANGE_PW, CHECK_USER, CREATE_DB, and CREATE_USER ![cloudhadoop-sql-procedure1_ko](https://cdn.document360.io/6998976f-9d95-4df8-b847-d375892b92c2/Images/Documentation/cloudhadoop-sql-procedure1_en.png?sv=2026-02-06&spr=https&st=2026-11-17T06%3A09%3A30Z&se=2026-11-17T07%3A09%3A30Z&sr=b&sp=r&sig=Y%2FiLUygGqD6Gf%2F35Jjyt6esAocpaaCsSVa1urJf9nMQ%3D) ### Create the database To create a database: 1. Enter the name of the database you want to create through the `CREATE_DB` procedure. ``` call CREATE_DB('new_database'); ``` - Example of the database name: `new_database` 2. Run the `show databases;` commands to check the newly created database. ![cloudhadoop-sql-procedure2_ko](https://cdn.document360.io/6998976f-9d95-4df8-b847-d375892b92c2/Images/Documentation/cloudhadoop-sql-procedure2_en.png?sv=2026-02-06&spr=https&st=2026-11-17T06%3A09%3A30Z&se=2026-11-17T07%3A09%3A30Z&sr=b&sp=r&sig=usI20xDy6fxeFMH3QIe6n3fHNAU2ca5v5%2FxCMOJsUAI%3D) ### Create the user account and view the list of user accounts To create a user account and view the list of user accounts: 1. Enter the user account to create and the password through the `CREATE_USER` procedure. ``` call CREATE_USER('new_user', 'password1!'); ``` - Example of the user account: `new_user` - Example of the password: `password!` 2. View the list of accounts and check if the user account is created through the `CHECK_USER` procedure. ``` call CHECK_USER(); ``` ![cloudhadoop-sql-procedure3_ko](https://cdn.document360.io/6998976f-9d95-4df8-b847-d375892b92c2/Images/Documentation/cloudhadoop-sql-procedure3_en.png?sv=2026-02-06&spr=https&st=2026-11-17T06%3A09%3A30Z&se=2026-11-17T07%3A09%3A30Z&sr=b&sp=r&sig=dGL4ksuUsBNUDAZIwZVUFQtPXtoZm2rlmxub22pIT0U%3D) ### Change password To change the password: 1. Through the `CHANGE_PW` procedure, enter the name of the account whose password you want to change and the new password. ``` call CHANGE_PW('new_user', 'change_pw2@'); ``` - Example of the target user account: `new_user` - Example of the new password: `change_pw2@` 2. Check if the `Query OK` message is output. If the message is output properly, you can access it with the changed password after that. ![cloudhadoop-sql-procedure4_ko](https://cdn.document360.io/6998976f-9d95-4df8-b847-d375892b92c2/Images/Documentation/cloudhadoop-sql-procedure4_en.png?sv=2026-02-06&spr=https&st=2026-11-17T06%3A09%3A30Z&se=2026-11-17T07%3A09%3A30Z&sr=b&sp=r&sig=aKU%2B2qV%2Fll0z5IYEp0%2F2S0iOxidzjJsT%2BzfgMlzcUEM%3D)