25th Anniversary Savings | 25% Off Dedicated Servers*Shop Now
25th Anniversary Savings | 25% Off VPS Hosting* †††Shop Now
Limited Inventory: High-Performance AMD-Powered Servers Now Available.* Shop Now >

How To: Create a MySQL Database and User in cPanel

Posted on by Patrick Hawkins
Reading Time: 2 minutes

Installation instructions for Content Management Systems (CMS) often require you to create a MySQL database for the application. But just how is that done on a cPanel server?

In cPanel, scroll down to the MySQL section and click “MySQL Databases”:

cPanel X-1

The first section, “Create New Database”, is where we will be creating the database. By default, cPanel prefixes the name of your MySQL database with the username of your cPanel account. Enter your database name, and click “Create Database”.

cPanel X-2

Before your database can be used, you need to create a MySQL user to access the database. For security reasons, it is best to create a separate MySQL user for every database that you set up on your server. If one user is compromised, it only impacts one database.

Create MySQL User

Choose a username that is not longer than 7 characters. After deciding on a strong password, click “Create User”. Make a note of the full username (with the cPanel account name prefix) and the password, as you will need this information later when installing your CMS.

MySQL users need to be added to the database before they can start using the database. In cPanel, it is a simple matter of selecting the user and database from dropdown menus and clicking “Add”.

cPanel X-3

On the next screen, you will need to give the user the privileges it will have over the database. Your CMS’s installation instructions may specify the privileges it needs; if it does not, it is easiest to select All Privileges. After your selection, click “Make Changes”.

Add MySQL User Privileges

When you are finished, the database should show in the “Current Database” list as having the user you assigned to it:

Current Database List

Congratulations! Your database is now ready to store data for your application.

Avatar for Patrick Hawkins

About the Author: Patrick Hawkins

Patrick Hawkins is a former Test Engineer and Managed WordPress admin with Liquid Web

Latest Articles

PHP 7 vs PHP 8: A Comparison

Read Article

How to Create a Symbolic Link

Read Article

What Is A Private VPS Parent?

Read Article

Managed Hosting vs Unmanaged VPS Hosting

Read Article

Why Is Your IP Address Blocked?

Read Article