How To: Create a MySQL Database and User in cPanel
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”:
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”.
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.
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”.
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”.
When you are finished, the database should show in the “Current Database” list as having the user you assigned to it:
Congratulations! Your database is now ready to store data for your application.
Related Articles:
- What is CentOS? Everything You Need to Know
- Check Apache Status with systemctl status and apachectl status Commands
- How to Find the Server Name Indication (SNI) Supporting Details
- How to Install Pip on CentOS 7
- Get Kernel Version for Linux: A Guide
- What Is a Time Series Database? How It Works & Use Cases

About the Author: Patrick Hawkins
Patrick Hawkins is a former Test Engineer and Managed WordPress admin with Liquid Web
Our Sales and Support teams are available 24 hours by phone or e-mail to assist.
Latest Articles
How to Install Apache Tomcat on Linux (AlmaLinux)
Read ArticleWhat is CentOS? Everything You Need to Know
Read ArticleWhat is CentOS? Everything You Need to Know
Read ArticleRedis as Cache: How It Works and Why You Should Use It
Read ArticleRefer-a-Friend Program for Website Hosting: Get $100 for Each Friend!
Read Article