Create a MySQL database, add a user with the right privileges and connect your app or WordPress to it, then manage it with phpMyAdmin in cPanel.

Create a MySQL Database and User in cPanel (With phpMyAdmin) - cPanel Guides guide by DignityHost
  • Applies tocPanel hosting plans
  • Time needed10 min
  • LevelBeginner

Every WordPress site, WooCommerce shop and most PHP applications need a database. In cPanel you create three things: a database, a user, and the link that gives the user permission to use the database.

Four steps: create the database, add a user, link them with all privileges, connect your application

Create, add a user, link, connect.

Create them with Manage My Databases

  1. In cPanel open Databases → Manage My Databases.
  2. Under Create New Database type a name (for example shop) and click Create Database. cPanel adds your account prefix, so the final name looks like cpuser_shop.
  3. Under MySQL Users → Add New User enter a username and a strong password (use the generator). Save the password somewhere safe.
  4. Under Add User To Database choose the user and the database, then click Add.
  5. On the privileges screen tick ALL PRIVILEGES and click Make Changes.

Prefer a guided flow? Database Wizard in the same section walks you through the same four steps.

Connect your application

SettingValue
Database hostlocalhost
Database nameThe full name with prefix, e.g. cpuser_shop
UsernameThe full username with prefix, e.g. cpuser_shopuser
PasswordThe one you created
Port3306 (default, normally not needed)

For WordPress, put these four values into wp-config.php:

php
define( 'DB_NAME', 'cpuser_shop' );
define( 'DB_USER', 'cpuser_shopuser' );
define( 'DB_PASSWORD', 'your-strong-password' );
define( 'DB_HOST', 'localhost' );

Manage data with phpMyAdmin

Open Databases → phpMyAdmin. Select your database in the left column, then use the tabs along the top:

  • Export: download a .sql backup of the whole database.
  • Import: upload a .sql file. Very large files can exceed the upload limit; ask support to import them directly from the server.
  • Search and Browse: find or edit rows, for example resetting a WordPress admin password hash.
  • Operations: rename or copy a database (take a backup first).
Be careful in phpMyAdmin
Drop and Empty delete data immediately and cannot be undone. Export a backup before changing tables by hand.

Common errors

MessageWhat to check
Error establishing a database connectionName, user or password mistyped in wp-config.php; user not added to the database; password changed.
Access denied for userThe user exists but was not given privileges on this database. Repeat the Add User To Database step.
Unknown databaseYou typed the name without the account prefix.
Too many connectionsA plugin or script is opening many connections. Disable the plugin or ask support to check slow queries.
Remote access
Databases accept connections from the same server by default. If a tool on your own computer must connect, use Remote Database Access and add only the specific IP address you need. Avoid wildcard hosts.

Frequently asked questions

Is it MySQL or MariaDB?

cPanel servers run MariaDB, which is fully MySQL-compatible, so applications that ask for "MySQL" work unchanged.

Why does the name have a prefix?

The prefix keeps your databases and users separate from other accounts on the same server.

How many databases can I create?

It depends on your plan; the number is listed on the hosting plan page.

Hosting with cPanel and MySQLFast, secure web hosting with free SSL, daily backups and free migration.
Web hosting plans →

References and further reading

Last reviewed 19 October 2026. Need a hand? Contact DignityHost support or open a ticket from your client area.

Was this answer helpful? 0 Users Found This Useful (0 Votes)