> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://help.namehero.com/sitemap.xml
> Use this file to discover available pages before exploring further.
> Pure-Markdown content can be obtained by appending a '.md' suffix to the content URLs listed in the sitemap (without the trailing slash).

# How To Add A User To A MySQL Database

Adding a user to an existing database is possible via cPanel and the 'Manage My Databases' feature inside cPanel.  Why would you need to do this?  There may be times where you may wish to have a user that only has access to certain 'parts' of a MySQL database.  This tutorial will show you how to add a user to an existing MySQL database.
​  
First, you need to make sure that you have *created the MySQL Database* that you would like to add the user to. For that article, please [click here](https://help.namehero.com/en/article/how-to-create-a-mysql-database-ptitpe/).  
​  
**STEP 1:**  Login to cPanel and click on Manage My Databases

![](https://storage.crisp.chat/users/helpdesk/website/-/a/7/9/f/a79f0cb367cf8000/iscreen-shoter-google-chrome-2_3b7cll.jpg)

  
​  
**STEP 2:** Scroll down to Add New User. Give your new user a name.  Note, all db usernames will have your cpanel user prepended with an underscore.
Example here: nameherotest_test2.  Give a password and click Create User.

![](https://storage.crisp.chat/users/helpdesk/website/-/a/7/9/f/a79f0cb367cf8000/iscreen-shoter-google-chrome-2_gnlfwx.jpg)​

**STEP 3:**  For now, check All Privileges.  You can define more restrictive privileges depending on your programming requirements.

![](https://storage.crisp.chat/users/helpdesk/website/-/a/7/9/f/a79f0cb367cf8000/iscreen-shoter-google-chrome-2_1g0551f.jpg)
**STEP 4:**  Once the user is created it's time to add it to a database!  At the bottom, click on the back button.

![](https://storage.crisp.chat/users/helpdesk/website/-/a/7/9/f/a79f0cb367cf8000/iscreen-shoter-google-chrome-2_1nbsunj.jpg)
**STEP 5:**  Scroll down the page to Add User To Database.  Choose from the drop down the user and db to add the user to.


![](https://storage.crisp.chat/users/helpdesk/website/-/a/7/9/f/a79f0cb367cf8000/iscreen-shoter-google-chrome-2_s22xgv.jpg)
**STEP 6:**  Once the user is added, you'll see it listed in the Current Databases.

![](https://storage.crisp.chat/users/helpdesk/website/-/a/7/9/f/a79f0cb367cf8000/iscreen-shoter-google-chrome-2_k32nad.jpg)


​  