glow-desktop glow-mobile glow-tablet bg-header banner pattern banner pattern

# Get Sorted

shape-left

Domains / Hosting

or browse the Help Centre by category

shape-right

How to create a MySQL database in cPanel

You’ll need to create both a MySQL database and a MySQL database User.

Log into cPanel
  1. Log into ClientZone.
  2. Click on the Hosting tab.
  3. Select the domain you want to use to create the MySQL database.
  4. Click on the ‘Website Manager’ button and then ‘Log into Website Manager’.
  5. Once in cPanel, scroll down to the option that says MySQL database and select it.

You will now see 2 sections, one is the current databases section and the other is the MySQL User section. As mentioned before, you will need to create a user, as well as the database, in order to access the MySQL database you create.

Create a Database
  1. Go to the top and you’ll see there is already a partial name, this is your cPanel name and your database will always be created with this prefix to make sure it’s identifiable to the server.
  2. Click ‘Create Database’ to continue. You’ll now see that your database has been added.
  3. Now click Go Back to create a user.
How to name your database. 

The best way to name your database is by using a name that relates to the content that will be stored in the database, so for instance if you create an ecommerce site you can use the name ‘shop’.

Create a Database User

Now you can see the database you just created under Current Database. You’ll notice there is no user added. We need to create one first.

  1. Go to Add a New User.
    You’ll see that the cPanel prefix is also going to be used for your username. Enter the name you want to use for your username.
  2. Now you need a password.
    Remember to make your password strong as databases carry a lot of sensitive information. If you’re worried you can use the Password Generator to create one for you. If you use your own password, you will be able to see the strength at the bottom of the section.
  3. Confirm your password and click Create a User.

Your user is now created. Click Go Back to finish creating your database.

You’ll now see the user you just created under Current users. We now need to assign that user to your database.

How to assign a Database User to your MySQL Database
  1. Go to the Add a User to a Database section.
  2. Select the user you want and the database you want to assign that user to.
    If you have more than one user or database, just select the dropdown menu and you will be able to choose the one you want to use.
  3. Click Add to proceed.

You now want to allocate the privileges you want the user to have when accessing the database. As this is the main user, you can simply click on All Privileges at the top of the screen.

Finally, select Make Changes. And your setup is complete.

Importing your SQL database. 

Now that you have created your database. Read the article to find out How to import a MySQL database via cPanel.

medium-image
How to create a MySQL database in cPanel
05:45

Afrihost Network Status

See the status of our broadband, mobile and hosting networks

For more details, visit our Network Status Page

ClientZone - just like magic

Manage products  .  Make payments  .  Check balances  .  Top up your account

Manage Products
Make Payments
Check Balances
Top Up your Account