Create a MySQL Database and User through cPanel


There are different ways to create a MySQL database and user. In one of our previous blog articles about MySQL database administration, we described how to create a new MySQL database and user through the command line which is pretty easy. If you have a Linux VPS with cPanel you can create a new MySQL database through the control panel with just few clicks of your mouse.cPanel is one of the most popular and widely used control panels. In this tutorial we will guide you through the process of creating a MySQL database and user, and assigning the user to the database, on a VPS with cPanel control panel.

First of all, login to cPanel at https://yourIPaddress:2083 or with your cPanel username and password.

Click on ‘MySQL Database Wizard’ icon under the Databases menu


Once there, enter a name for the new database you want to create in the New Database field and go to the next step as shown in the picture. You can notice that the databases created in cPanel start with a prefix, which is the cPanel username. The name of the MySQL database can contain 54 character maximum.


A new MySQL database is created and it will be listed in the ‘Current Databases‘ section.

On the next step we will have to create a new user for the database. This user will be the only user, except the MySQL ‘root’ user that will be able to access the newly created database. Type the new username in the ‘Username’ field (I can be 7 characters long and also starts with a prefix.) and enter a password for the user. You should always use strong password which is at least 10 characters long. You can use the ‘Password Generator’ tool provided by cPanel, to generate a strong passwords.

On the next screen, as shown at the screenshot below, you can add privileges to the database user. It is best to add all ‘All privileges’ to be sure that your application will work properly. After you add the desired privileges, click the ‘Next step‘ button to complete the process of creating a new MySQL database and user. With this step the MySQL database and user are ready and you can start using them for whatever you need.


If you need to delete a MySQL database, you can easily do that through the ‘MySQL Databases‘ menu. All created database are listed under ‘Current Databases’ and they can be deleted by clicking the ‘Delete‘ button under ‘Actions‘.

If you need more information about how to create a new MySQL database through cPanel you can check their official documentation.



Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

We use cookies to give you the best online experience. By agreeing you accept the use of cookies in accordance with our cookie policy.