🇺🇸 Welcome from the USA! We have special plans for you.
View US Hosting Plans →

Create a MySQL database in cPanel

📅 15/06/2026 ⏱ 5 min de lectura
PlatiniumHost

Escrito por

Luis Contreras · CEO & Fundador · +24 años en hosting

How to Create a MySQL Database in cPanel

MySQL databases are the backbone of most dynamic web applications, including content management systems (CMS) like WordPress, Joomla, or online stores like PrestaShop and Magento. They allow for efficient storage, organization, and retrieval of large volumes of information, from your site's content to user data and configurations.

At PlatiniumHost, managing your MySQL databases is greatly simplified thanks to the cPanel control panel. This detailed guide will walk you through the essential steps to create a MySQL database, set up a dedicated user for it, and assign the appropriate permissions. By the end of this tutorial, you will have a fully configured MySQL database ready to be used by your web application.

Step 1: Access Your cPanel

The first fundamental step is to log in to your cPanel control panel. Typically, you can access cPanel via a specific URL provided by PlatiniumHost, which usually follows the format your-domain.com/cpanel or cpanel.your-domain.com. Use your hosting account's username and password to log in.

Step 2: Create the MySQL Database

Once you have logged into cPanel, navigate to the 'Databases' section and click on the 'MySQL Databases' icon.

  1. In the 'Create New Database' section, you will find a field labeled 'New Database:'. Enter the desired name for your database. For example, if your site is 'mysite', you could use 'mysite_db'.
  2. Click the 'Create Database' button.

cPanel will automatically add a prefix to your database name, usually your cPanel account username followed by an underscore (e.g., username_mysite_db). It is crucial to note this full name, as you will need it to configure your web application.

Tip: cPanel's automatic prefix ensures that your database name is unique on the server, avoiding conflicts with other users' databases.

Step 3: Create a MySQL User

Once the database has been created, it is necessary to establish a specific user who will have access to it. For security reasons, it is good practice not to use the main cPanel user for the database. Scroll down to the 'MySQL Users' section and follow these steps:

  1. In the 'Add New User' section, enter a username in the 'Username:' field. For example, 'mysite_user'.
  2. Enter a strong password in the 'Password:' field and repeat it in the 'Password (Again):' field.
  3. Click the 'Create User' button.

As with the database, cPanel will apply a prefix to your username (e.g., username_mysite_user). It is essential to save this full username and password in a secure place, as they are vital credentials for your application's configuration.

Tip: Use the 'Password Generator' feature offered by cPanel. This will help you create a complex and secure password, which is essential to protect your database and, by extension, your website.

Step 4: Assign the User to the Database

Now that you have a database and a user, the next step is to connect both elements, granting the user the ability to interact with the database. Scroll down to the 'Add User to Database' section.

  1. In the 'User:' dropdown menu, select the MySQL user you just created (e.g., username_mysite_user).
  2. In the 'Database:' dropdown menu, select the MySQL database you created earlier (e.g., username_mysite_db).
  3. Click the 'Add' button.

Step 5: Grant User Privileges

After assigning the user to the database, cPanel will automatically redirect you to a page where you can define the user's privileges. These privileges dictate what actions the user can perform within that database (e.g., create tables, insert, update, or delete data, etc.).

  1. For the vast majority of web applications, the user will need full control over the database. Therefore, check the 'ALL PRIVILEGES' box.
  2. Click the 'Make Changes' button.

Congratulations! You have successfully completed the creation of a MySQL database, set up a dedicated user, and assigned all necessary privileges. Your database is now fully ready to be used by your application.

Important: Although 'ALL PRIVILEGES' is the standard setting for most web applications, in high-security environments or for users with very specific functions, it is recommended to assign only the minimum essential privileges.

Conclusion

Creating a MySQL database in cPanel with your PlatiniumHost service is a straightforward and efficient process. You now have the three essential pieces of information: the full database name, the full database username, and that user's password. These details will be required when you configure your web application (such as WordPress, Joomla, etc.), usually in a specific configuration file.

If at any time you encounter any difficulty or have additional questions, do not hesitate to contact the PlatiniumHost technical support team. We will be happy to provide you with the necessary assistance.

💬 ¿En qué podemos ayudarte?

Selecciona un agente de soporte

¿Hablamos?