--- title: "Creating DB and managing account with MySQL stored procedures" slug: "hadoop-chadoop-3-10" updated: 2026-09-17T09:18:00Z published: 2026-09-17T09:18:00Z canonical: "guide.ncloud-docs.com/hadoop-chadoop-3-10" 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. # Creating DB and managing account with MySQL stored procedures Available in Classic MySQL stored procedure is a collection of SQL statements for performing a series of procedures organized so that it can be executed as `CALL function();`. It provides four features: creating a user account, creating a new DB, changing a password, and checking the created account list. ## MySQL DB access In order to run MySQL Stored Procedure, you have to connect to the cluster server where the DB is installed, and then access the MySQL DB. The following describes how to access a MySQL DB. 1. Connect to the cluster server directly. (Refer to [Connecting to cluster nodes through SSH](/docs/en/hadoop-chadoop-3-2)) 2. Run the following command to access the MySQL DB. ``` $ mysql -h mysql.local -u -p Enter password: Password ``` - - Enter the user account in `<User Account>` and run it. When `Enter password:` is displayed, enter the account password. ## How to use stored procedure ### Check procedure creation The following describes how to view created procedures. 1. Run the `show databases;` command, and use the following command to access the Ambari DB among the printed DB list. ``` use ambari_{unique number}; ``` - Enter the name of the database you want to actually access in the location of `ambari_{unique number}`. 2. Run the `show procedure status;` command to view the 4 procedures created in the Ambari DB. - Currently available procedures: CREATE_DB, CREATE_USER, CHANGE_PW, CHECK_USER ![cloudhadoop-sql-procedure1_en.png](https://cdn.document360.io/6998976f-9d95-4df8-b847-d375892b92c2/Images/Documentation/cloudhadoop-sql-procedure1_en.png?sv=2026-02-06&spr=https&st=2026-10-27T18%3A30%3A14Z&se=2026-10-27T19%3A30%3A14Z&sr=c&sp=r&sig=dJx5Vbymsjl3zcm5Gm0yNl6%2Fy03SLnU%2BLc5TdZ4fOoI%3D) ### Create database The following describes how to create a database. 1. Enter a name for the database to be created with the `CREATE_DB` procedure. ``` call CREATE_DB('new_database'); ``` - Database name example: `new_database` 2. Run the `show databases;` command to check the newly created database. ![cloudhadoop-sql-procedure2_en.png](https://cdn.document360.io/6998976f-9d95-4df8-b847-d375892b92c2/Images/Documentation/cloudhadoop-sql-procedure2_en.png?sv=2026-02-06&spr=https&st=2026-10-27T18%3A30%3A14Z&se=2026-10-27T19%3A30%3A14Z&sr=c&sp=r&sig=dJx5Vbymsjl3zcm5Gm0yNl6%2Fy03SLnU%2BLc5TdZ4fOoI%3D) ### Create user account and view user account list The following describes how you can create a user account and view the list of user accounts. 1. Enter the user account and password to create with the `CREATE_USER` procedure. ``` call CREATE_USER('new_user', 'password1!'); ``` - User account example: `new_user` - Password example: `password!` 2. Use the `CHECK_USER` procedure to check the account list to see if the user account has been created. ``` call CHECK_USER(); ``` ![cloudhadoop-sql-procedure3_en.png](https://cdn.document360.io/6998976f-9d95-4df8-b847-d375892b92c2/Images/Documentation/cloudhadoop-sql-procedure3_en.png?sv=2026-02-06&spr=https&st=2026-10-27T18%3A30%3A14Z&se=2026-10-27T19%3A30%3A14Z&sr=c&sp=r&sig=dJx5Vbymsjl3zcm5Gm0yNl6%2Fy03SLnU%2BLc5TdZ4fOoI%3D) ### Change password The following describes how to change a password. 1. Use the `CHANGE_PW` procedure to enter the account name of which you wish to change the password, and a new password. ``` call CHANGE_PW('new_user', 'change_pw2@'); ``` - Target user account example: `new_user` - Changed password example: `change_pw2@` 2. Check if the `Query OK` message has been printed. If the message is successfully printed, then the user can now log in with the new password. ![cloudhadoop-sql-procedure4_en.png](https://cdn.document360.io/6998976f-9d95-4df8-b847-d375892b92c2/Images/Documentation/cloudhadoop-sql-procedure4_en.png?sv=2026-02-06&spr=https&st=2026-10-27T18%3A30%3A14Z&se=2026-10-27T19%3A30%3A14Z&sr=c&sp=r&sig=dJx5Vbymsjl3zcm5Gm0yNl6%2Fy03SLnU%2BLc5TdZ4fOoI%3D)