Add a MySQL Database in cPanel

The following article explains how to add a MySQL database in cPanel. You can use cPanel's built-in MySQL database interface to add new MySQL databases. This procedure must be performed as the user for the domain, rather than as the administrator. Before you create the database, you must ensure the MySQL service is running.

To ensure the MySQL service is running, please follow these steps:

  1. Open a web browser and connect to your WHM Control Panel located at https://<server_ip address>:2087.
  2. Login as the user for the domain.
  3. From the left side menu, under SQL Services, click Show MySQL Processes.

  4. If the screen is blank, you will need to start the service. If it displays information about processes, you can skip to the next section.
  5. From the left side menu, under Service Configuration, click Service Manager.

  6. Check Enabled for mysql.

    To add a MySQL database, please follow these steps:

  1. While still in WHM (https://<server_ip address>:2087), from the left side men under Account Information, click List Accounts. If you do not have this information, please skip to step 3.
  2. Find the appropriate domain and click the cPanel icon to enter the cPanel Reseller Menu. A new window will open and you will be logged in as the domain administrator for the domain.
  3. Once logged into cPanel for the domain (typically, click MySQL databases under the Databases section.
  4. Enter a name for the database and click Create Database.
  5. Once the database creation completes, click Go Back.
  6. Enter a username and a strong password for the database and click Create User.
  7. Once the user creation completes, click Go Back.
  8. Now you need to add the user to the database. Under Add User To Database, select the appropriate user and database.
  9. Click Submit.
  10. Select the appropriate database permissions for the user and click Make Changes.

  11. The database you created should now be displayed with the user you selected and you can now connect to it from code or externally.

  • 29 Users Found This Useful
Was this answer helpful?

Related Articles

PCI Compliance in cPanel

PCI scans will often fail for weak SSL ciphers and older protocols. In order to disable older...

Temporary URL for cpanel accounts

The temporary URL is used when your domain name is not working. Here is an example of the...

Modify Pre-Existing Default Accounts on cPanel

Although the default address can be easily changed in the WHM, this setting only applies to...

How to find the correct path to the working php.ini file in WHM cPanel

run # php -i | grep php.ini at the command line. This will output the path to the php.ini file...

Exim: Blackhole vs Fail

In the ever-present fight against spam, it's always wise to make your server as robust as...