> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://help.serverfreak.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 and Assign User to MySQL Database

1. Login to your cPanel account.
![](https://storage.crisp.chat/users/helpdesk/website/0e35a1b5-ce97-4d12-a27e-1bbafd0ae641/dda7eb4d-58f1-49b8-b9c5-ad814fab29b0.png)


2. Click on **"MySQL Databases"** as seen below
![](https://storage.crisp.chat/users/helpdesk/website/0e35a1b5-ce97-4d12-a27e-1bbafd0ae641/7588818c-c1ef-4dac-966a-f545d8fa3f2a.png)


3. Type the name of your new database under **“Create New Database”** and press **“Create Database”**.
![](https://storage.crisp.chat/users/helpdesk/website/0e35a1b5-ce97-4d12-a27e-1bbafd0ae641/6a69fd1f-ef9c-4be7-baf7-8903bb991f91.png)
You shall see the message: **“Added the database yourusername_newdatabase”**. Hit the **“Go back”** button.

4. Now, scroll down to the bottom to **“MySQL Users”**.  Enter your preferred username and password and hit **“Create User”**. 

You can also choose a randomly generated password by selecting **“Generate Password”**.

![](https://storage.crisp.chat/users/helpdesk/website/0e35a1b5-ce97-4d12-a27e-1bbafd0ae641/f243c0fb-03f1-4583-a27c-fc22de9d1805.png)




5. You shall see the message “You have successfully created a MySQL user named “youruser_newdata”.” Hit the **“Go Back”** button.



6. Next, we scroll down to **"Add Username to Database"** section and assign our newly created username to our newly created database. In this example shown below, user  "youruser_newdata" will be assigned to "youruser_newdatabase". Remember to hit the **"Add"** button.

![](https://storage.crisp.chat/users/helpdesk/website/0e35a1b5-ce97-4d12-a27e-1bbafd0ae641/d6396b0d-b7c3-47d2-9868-843553515188.png)


7. Tick on **“All Privileges”** and hit the **“Make Changes”** button.



8. You shall see that your new user is now assigned to your new database.