All Collections
Configuring, Customizing & Troubleshooting
Configuration
How To Create, Manage, And Setup MySQL Databases Inside cPanel
How To Create, Manage, And Setup MySQL Databases Inside cPanel

If you're using an application such as WordPress, the data from your website is stored in a mySQL database. Learn how to manage it all.

Ryan Gray avatar
Written by Ryan Gray
Updated over a week ago

At NameHero we use a mySQL drop-in replacement called MariaDB. MariaDB was created by one of the founders of mySQL and is known for high performance and reliability. Since it's a drop-in replacement it will function the same as mySQL, meaning all of your mySQL applications, such as WordPress will work, but with better performance.

Using The cPanel mySQL Dashboard

cPanel provides an easy way to create and manage your mySQL databases right inside of your web browser. You can easily find all the functions under the "databases" section of the cPanel dashboard:
โ€‹

  • phpMyAdmin - This tool gives you the ability to make very specific changes to your databases. It's recommended for advanced users, and is most often not needed into day-to-day management. Only use this if you specifically know what you're doing.

  • mySQL Databases - This option will list all of the databases inside your cPanel account. This is where you would go to create a new database, delete one, create a database user, or assign user permissions to a specific database.

  • mySQL Database Wizard - This setup wizard easily guides you through the process of create a new database. If you're a beginner, this provides a very simple way to create a new database, user, and ensure it has proper permissions.

  • Remote mySQL - This section gives you the ability to connect remote websites (not hosted with NameHero) the ability to connect to databases on your account. This can present a severe security risk, therefore you should contact our team to explain your request so the proper security precautions can be taken prior to setup. Most users needing this setting will need a VPS or Cloud Dedicated Server.

How To Create A mySQL Database

Please note: If you're installing a popular application such as WordPress/Drupal/WHMCS, it's highly recommended you do this inside of cPanel -> Softaculous Apps Installer as it'll not only automatically create the database and database user for you, it'll also install the files and setup your basic configuration very easily. See How To Install WordPress for more details.

If you're installing an application that requires a new mySQL database, you you easily accomplish this by going to cPanel -> mySQL Database Wizard:

Step 1: Create A Database

To get started, you'll need to enter a unique name for your database. It's important to make this unique and no longer than 54 characters.

Step 2: Create Database Users

  • Username: Just as you create a name for your database, you'll need to create a unique user to access that database. I personally recommend naming this something that you'll easily be able to identify in relation to the database (i.e. mynewdbuser1)

  • Password: It's VERY important you use a strong password here as if it's weak, your site is wide open for attackers to compromise. Therefore click the Password Generator to easily create a strong one. If the "Strength" meter doesn't say "Very Strong" - you should not proceed. Make note of the password as you'll need it when setting up your application.

Step 3: Add User To The Database

This step assigns specific permissions to your database user. For most applications you can check "All Privileges" but depending on your application, you should check with the developer.

Step 4: Complete The Task

Congratulations! At this point, you've successfully create a new database, database user, and assigned the permissions. You're now reading to continue setting up your application.

How To Manage mySQL Databases

You can easily manage all of your mySQL Databases and mySQL users by selecting the mySQL Databases option from the cPanel dashboard:
โ€‹

Create New Database

While you can quickly create a new mySQL database from here, it's highly recommended to use the Setup Wizard explained above to ensure the proper user is created with sufficient privileges. Only advanced users should use this option here.

Modify Databases

Check Database - If you're experiencing issues with your application, most notable seeing database errors in your /public_html/error_log you may wish to use this option to check and see if the database contains errors. Simply use the drop-down menu to select the database you're having trouble with and click Check Database. It'll return a screen like this:

This tool is very safe, as it doesn't perform any actions that would modify the data, it only checks the structure to see if there is some corruption. As you can see in the above screenshot, this example WordPress database checked out just fine. If there were errors, then we could proceed to the second option.

Repair Database - If the above step indicated signs of corruption in your database, this tool can repair certain tables if they're using the MyISAM storage engine. If the above check indicated errors, you can run this tool to attempt to repair those tables. Since my check above was clean, if I run this tool it simply returns a message like this:

Once again, you should only run the repair if the above step indicated errors. It's also a good idea to take a backup of your database prior to running this tool.

Current Databases

This section shows a summary of all the mySQL databases on your account, with the disk size, users, and specific actions.

If you've installed your application using the Softaculous Apps Installer and you're wanting to remove it (i.e. delete WordPress), you should go to that dashboard to carry it out.

Extreme caution should be taken when making any modifications as this will permanently remove any data stored. Additionally, renaming a database or removing a user could cause your website to no longer function properly.

Add New mySQL User

This section allows you to add a new database user which you can assign to a specific database. If you're creating a new database, you should use the wizard mentioned above. This section should only be used by advanced users who specifically know what they're doing.

Add User To Database

This allows you the ability to connect a new or existing database user to a specific database. As noted above, this should only be completed if you're an advanced user and specifically know what you're doing as this can present a security risk.

Current Users

This section shows a summary of all the database users on your account and allows you to make changes such as resetting a password, renaming the user, or deleting the all together.

Changes made here can cause your website to not operate properly so any changes here should be made with extreme caution.

Did this answer your question?