Most websites, from WordPress to custom PHP apps, store their content in a MySQL (MariaDB) database. In cPanel a working database needs three things: the database, a user, and that user added to the database with privileges. The Database Wizard does all three in one flow.
Before you start
- Access to cPanel.
- A name for the database, such as
shop. cPanel adds your username as a prefix, so it becomescpuser_shop.
Create a database with the Database Wizard
- Open cPanel → Databases → Database Wizard.
- Step 1: type the database name after the prefix and click Next Step.
- Step 2: enter a username (after the prefix, up to about 32 characters in total) and a strong password. Use Password Generator and copy the password somewhere safe. Click Create User.
- Step 3: tick ALL PRIVILEGES and click Next Step. Apps need these to create and update their tables.
- Step 4: cPanel confirms the user was added to the database.
Or use Manage My Databases
For more control, open cPanel → Databases → Manage My Databases (called MySQL Databases in older versions):
- Under Create New Database, enter the name and click Create Database.
- Under Database Users → Add New User, create the user.
- Under Add User To Database, pick the user and database, click Add, tick ALL PRIVILEGES and click Make Changes.
The same page lets you rename or delete databases, change user passwords, and run Check Database and Repair Database on damaged tables.
Connect your application
| Setting | Value |
|---|---|
| Database host | localhost |
| Database name | cpuser_shop (with prefix) |
| Username | cpuser_shopuser (with prefix) |
| Password | The password from step 2 |
| Port | 3306 (default; most apps do not need it) |
For WordPress these go in wp-config.php as DB_NAME, DB_USER, DB_PASSWORD and DB_HOST. If you install apps with Softaculous, it creates the database for you.
Note: Database size counts toward your disk quota. Check it on the Manage My Databases page.
Troubleshooting
"Access denied for user"
The password is wrong, the prefix is missing, or the user was never added to the database. Reset the password under Current Users → Change Password and re-check Privileged Users in the database list.
"Error establishing a database connection"
See fix database connection errors on cPanel.
Name too long
Shorten the part after the prefix. The full name and username have length limits.
