Setting-up a MySQL Database in cPanel 
For purposes of this manual, I am using screenshots from the cPanel X theme. Your cPanel theme may differ, but the instructions will remain virtually the same.
The only notable difference is if you are using the cPanel Advanced theme. If that's the case, click the [Advanced Tools] then the [MySQL Databases] and join us again at the next step.
For all others, you should see a screen something like the one in the figure below. Click the [MySQL Databases] icon.

On this screen, you will enter the database name you want in the blank next to [db:] then click [Add DB].

Once you have clicked [Add DB] you will be brought to a redirect screen confirming the creation of the database. Click the [back] or [Go Back] link to return to the main MySQL screen.

Now we have to create the database user and password. Scroll down the screen until you see this:

Enter the database username and password you want in the appropriate blanks and click the [Add User].

Once you have clicked [Add User] you will be brought to a redirect screen confirming the creation of the username and password. Click the [back] or [Go Back] link to return to the main MySQL screen.

Now you have to add the user to the database so they can have access and control. Scroll until you see this:

Using the drop-down menus, make sure you have selected the proper user and database, then click [Add User to DB].

Again, you will be sent to the redirect screen confirming the addition of the user to the database. Again, click the [back] or [Go Back] link to return to the main MySQL screen. You should see something like this:

These are the database name, username and password you will use in the config.php file.
Note:
cPanel will always preface the database name and database username with your main account username and an underscore.
If you chose the database name [forums] and the database username [user] your database will be [mainusername_forums] and your database username will be [mainusername_user]
User Contributed Notes: Setting-up a MySQL Database in cPanel Add a Comment