Before installing WordPress, Joomla, or any PHP-based application, you need a MySQL database. cPanel makes this process straightforward. Here's how to create a database, add a user, and assign the correct permissions — all in under two minutes.
Step 1 — Open MySQL Databases
- Log in to your cPanel account.
- Scroll to the Databases section.
- Click MySQL Databases.
Step 2 — Create the Database
- Under Create New Database, enter a database name (e.g.,
wordpress). - Click Create Database.
Your full database name will be cpanelusername_wordpress (cPanel prefixes your username automatically).
Step 3 — Create a Database User
- Scroll to MySQL Users → Add New User.
- Enter a username (e.g.,
wpuser) and a strong password. - Use the Password Generator for a secure password — copy it somewhere safe.
- Click Create User.
Step 4 — Add User to Database
- Scroll to Add User to Database.
- Select the user (
cpanelusername_wpuser) and the database (cpanelusername_wordpress). - Click Add.
- On the next page, check ALL PRIVILEGES.
- Click Make Changes.
Your Database Details
Note these details — you'll need them when configuring your application:
| Setting | Value |
|---|---|
| Database Host | localhost |
| Database Name | cpanelusername_wordpress |
| Database User | cpanelusername_wpuser |
| Password | The password you set in Step 3 |
Verify via Terminal (Optional)
If you have SSH access, verify the database was created:
mysql -u cpanelusername_wpuser -p -e "SHOW DATABASES;"
You should see cpanelusername_wordpress in the list.
You're now ready to install WordPress or import your SQL backup. Check out our guide on how to restore a SQL database in cPanel using the terminal to import your data.