How to Create a WordPress Database from CPanel

Last updated on June 25th, 2020 by Robert Abela. Filed under WordPress Security Tutorials & Tips

WordPress is a blogging platform built with PHP and it requires a MySQL database to function. If you will install WordPress on shared hosting service such as HostGator, you can create the MySQL database for WordPress from the CPanel. In this easy to follow WordPress tutorial we explain how to create a WordPress database using the CPanel wizard in just 5 steps.

If you host WordPress on your own server, you can create a MySQL database for WordPress using phpMyAdmin or the MySQL command line.

Creating a MySQL WordPress database from CPanel

  1. Login to your hosting provider CPanel, scroll down to the Databases section shown in the below screenshot and click on MySQL database wizard.

Database options in CPanel

  1. In Step 1 of the wizard you have to specify a database name. Notice that most hosting provider add the username as database prefix, as shown in the below screenshot. The name of the database in this example is WPPro_WPDB8732. Click Next Step button to proceed with the MySQL database wizard.

Step 1 of MySQL Database Wizard in CPanel to Create a MySQL Database

WP White Security Security Tip: Avoid using predictable database names, such as blogdatabase or blogdb. In case a malicious user tries to guess the WordPress database name, by using non predicatable names you make it more difficult to guess.

  1. In Step 2 of the wizard you have to create a user which will be used to access the database. As per the example in the below screenshot, the username we created is WPPro_C0lloqu1. Once you specify a very strong password for the new user, click on “Create User” to proceed with the wizard.

Step 2 of MySQL Database Wizard in CPanel to Create a user for the WordPress MySQL database

  1. In Step 3 of the wizard, you will add the user to the database and specify its privileges as seen from the below screenshot.

Step 3 of MySQL Database Wizard in CPanel to add user to MySQL database and assign privileges

WP White Security Security Tip:  Typically the MySQL user only needs SELECT, INSERT and UPDATE data privileges for WordPress to function. Any other privileges, such as ALTER, CREATE and DROP are sometimes needed during an upgrade or when installing plugins and database structure changes are needed.  In such cases, you will be advised by the plugin developer. It is important that whenever you assign structure related privileges, it should ONLY be temporary. You can read more about WordPress database privileges from the article Why minimum MySQL user WordPress database privileges help.

  1. In Step 4 of the MySQL database wizard you are advised that the newly created user has been added to the database you’ve created, as seen in the below screenshot. If you want to proceed with a WordPress install, then use the database name, username and password you have specified in this MySQL database CPanel wizard.

Step 4 of MySQL Database Wizard in CPanel - Complete the task - MySQL database and user created

Leave a Reply

Your email address will not be published.

Our other plugins