cPanel & Hosting How-Tos How to Create a MySQL Database and User in cPanel
Most websites and apps — WordPress, Joomla, custom PHP — store their content in a MySQL database. If you’re installing an app manually, you’ll need to create a database, a database user, and connect the two. Here’s how in cPanel.
Installing WordPress? The 1-click installer (Softaculous) creates the database for you, so you can skip this. These steps are for manual installs or apps that need their own database.
Step 1: Create the database
- In cPanel, open MySQL Databases (under Databases).
- Under Create New Database, type a short name, for example
wpdb. - Click Create Database.
cPanel adds your account username as a prefix, so the real name becomes something like user_wpdb. Write down the full name — you’ll need it exactly.
Step 2: Create a database user
- On the same page, scroll to MySQL Users → Add New User.
- Enter a username (also prefixed, e.g.
user_wpuser). - Use the Password Generator for a strong password and save it.
- Click Create User.
Step 3: Add the user to the database
- Scroll to Add User To Database.
- Select your user and your database, then click Add.
- On the privileges screen, tick ALL PRIVILEGES, then Make Changes.
The user can now fully manage that database.
Step 4: Collect your connection details
Your application will ask for four things:
| Setting | Value |
|---|---|
| Database host | localhost (on most cPanel servers) |
| Database name | user_wpdb (the full prefixed name) |
| Database user | user_wpuser (the full prefixed name) |
| Database password | the one you generated |
Enter these in your app’s configuration (for WordPress, that’s wp-config.php or the install screen).
Managing your database later
- To view or edit tables directly, open phpMyAdmin in cPanel.
- To back up a database, use phpMyAdmin’s Export, or your full account backup in cPanel.
- To remove an old database, return to MySQL Databases and delete it — but export a backup first.
A fast database needs fast storage
Database-driven sites feel slow when the disk is slow. Our hosting runs databases on NVMe SSD storage with LiteSpeed, so queries return quickly even as your site grows. If a busy database is straining shared resources, a Managed VPS gives it dedicated CPU and memory.
Frequently asked questions
What should I use as the database host?
On most cPanel servers the host is localhost, because the database and website run on the same server. If your app asks for a host and localhost does not work, check your welcome email or ask support for the correct hostname.
Why is my database name prefixed with my username?
cPanel adds your account username as a prefix (like user_wpdb) to keep database names unique on a shared server. Always use the full prefixed name, including the underscore, when you connect.
What privileges does my database user need?
For most applications, grant ALL PRIVILEGES to the user on its database. This lets the app read, write and update data and create its own tables during installation.