// cpanel hosting

How to Create and Manage MySQL Databases in cPanel: Step-by-Step Guide

August 05, 2026 · by CLIQHOST

How to Create and Manage MySQL Databases in cPanel: Step-by-Step Guide

Every dynamic website — whether it runs WordPress, Joomla, Magento, or a custom application — needs a MySQL database. cPanel provides a clean visual interface that lets you create and manage databases without writing a single SQL command. This guide walks you through the entire process from scratch.

Why Proper Database Setup Matters

A misconfigured database or overly broad permissions can lead to application errors, security vulnerabilities, or data loss. A few minutes spent on correct setup can save you hours of troubleshooting down the line.

Step 1: Open the MySQL Databases Section

  1. Log in to cPanel (typically at https://yourdomain.com:2083).
  2. Under the Databases section, click MySQL Databases.

Here you'll see a list of existing databases and a form to create new ones.

Step 2: Create a New Database

  1. In the New Database field, enter a descriptive name, for example: shop.
  2. Click Create Database.

Note: cPanel automatically prepends your account username as a prefix. If your cPanel username is cliquser, the database will be named cliquser_shop.

Step 3: Create a MySQL User

Never use the root user or your general hosting account credentials for applications. Create a dedicated user instead:

  1. Scroll down to the MySQL Users section.
  2. Enter a username (e.g., webuser) and a strong password.
    - Use the built-in password generator for a password of at least 12 characters.
  3. Click Create User.

The user is created but currently has no access to any database.

Step 4: Add the User to the Database

  1. In the Add User To Database section, select the user and database from the dropdown menus.
  2. Click Add.
  3. On the next screen, check the required privileges:
    - ALL PRIVILEGES — suitable for CMS applications like WordPress or Joomla.
    - Granular privileges (SELECT, INSERT, UPDATE, DELETE) — recommended for custom apps where strict access control is needed.
  4. Click Make Changes.

Step 5: Connect Your Application to the Database

Once everything is set up, use these connection details in your application:

Host:     localhost
Database: cliquser_shop
User:     cliquser_webuser
Password: your_password
Port:     3306

For WordPress, these values go into the wp-config.php file:

define( 'DB_NAME',     'cliquser_shop' );
define( 'DB_USER',     'cliquser_webuser' );
define( 'DB_PASSWORD', 'your_password' );
define( 'DB_HOST',     'localhost' );

Step 6: Manage Your Database with phpMyAdmin

cPanel includes phpMyAdmin, a visual tool for managing tables, importing/exporting data, and running SQL queries.

  1. From the Databases section in cPanel, click phpMyAdmin.
  2. Select your database from the left-hand panel.
  3. From here you can:
    - Import an .sql file (e.g., when migrating a site).
    - Export the database as a backup.
    - Manually edit, delete, or add records.

Tip: Before making any major changes, always export a full database backup first.

Common Mistakes to Avoid

  • Excessive privileges: Don't grant ALL PRIVILEGES if the application only needs read access.
  • Weak passwords: A password like admin123 exposes your database to brute-force attacks.
  • One user for all databases: Each application should have its own dedicated MySQL user.
  • No backups: Set up automatic backups via cPanel → Backup Wizard.

Conclusion

Creating and managing MySQL databases in cPanel is a straightforward process when you follow the right steps. The key is separating users, using strong passwords, and granting only the minimum required permissions. These best practices protect your data and significantly reduce security risks.

If you need fast, reliable cPanel hosting for your project, CLIQHOST offers shared hosting plans with cPanel included, optimised for WordPress and other popular CMS platforms.

SHARE
// what clients say

What Our Clients Say

Real reviews from customers who trust CLIQHOST for performance, reliability and expert technical support.

★★★★★

"We moved our online shop from a foreign host and the difference is night and day — pages load instantly and support replies in minutes, in Romanian."

AM
Andrei M.
eCommerce owner · Chișinău
★★★★★

"Migrated 12 client sites to CLIQHOST. Free migration, zero downtime, and the cPanel setup is exactly what my team needed. Highly recommend."

EV
Elena V.
Web agency · Bălți
★★★★★

"Our NVMe VPS handles traffic spikes without a sweat. Full root, local datacenter, and billing in MDL — everything we wanted from a provider."

DC
Dmitri C.
SaaS founder · Chișinău