How to install a MySQL Database using cPanel Hosting Panel using x3 Theme

First thing to do is login to cpanel and scroll the to the bottom.

Many times you can access your cpanel by going to

For this example we will be using the x3 theme with a modified template. The colors on yours might be different but everything should be laid out the same.

Select the option that says MySQL Databases.

New MySQL Database

Next we will need to setup the database.

Notice how to the left of the textbox it says “mileka_”, this means my database name will be mileka_tmp

Pick a name you would like to use, for this example i will be
using tmp as this is only a temporary database for this example.

Pick anything you would like, testimonials would work fine.

Our new database is now mileka_tmp

New MySQL Database User

Now that we have created a database we will need to create a user account for the database.

This can be anything you would like, some people will use the database name as the user.

For this example we will be using tmpuser because as we said before this is only temporary. We suggest using the “password generator”

Now our new database name is mileka_tmpuser

Add user to MySQL Database

Add user to MySQL Database

So we’ve got our database setup and our username setup,
now we need to add the user to database so it keeps our database “secure”.

If you scroll to the bottom of the same page we have done everything else on you will see something that looks like the image to the left.

Select the database your username that we just setup.

Click the add button.

MySQL User Privileges

MySQL User Privileges

This will bring us to the section where we can specify privileges for the user account.

Since have no reason to not allow our user all permissions, and we don’t know exactly what it will need.

Just select all privileges and it will select everything for you.

Click make changes.

That’s it! Easy right?

We have now setup a MySQL database through cPanel and added a user with full privileges to that database.


Orlando, FL

Did this post help you?

Give back and rate it for me!

Related Posts

  • Anthony

    Very much loved and appreciated this tutorial… I am new to php… phpMyAdmin and MySQL. The problem that I’m having is that phpMyAdmin is set up differently. I believe I created a database… it’s next asking me to create the tables for it. this step is not in any of the instructions so I have been trying to connect without the tables.
    I keep getting error code:
    Could not connect: Can’t connect to local MySQL server through socket ‘/tmp/mysql.sock’ (46)

    I don’t know what the…

    Any help would be greatly appreciated!

    • You’re welcome. After you setup the database, the user, and then add the users to the database as in the tutorial, everything is setup. Now what you need to do is take all the information you used and plug it in your PHP file.

      That error you’re getting is saying that it either doesn’t have permissions or tmp is full. This is something you should contact your hosting company about and they should fix it for you.

      Here’s a site i found regarding it if you’re curious:

      If you’re using XAMPP or something like that follow the directions above. If you need a host email me and I will give you a free account on one of our shared servers.