Create a MySQL database for your website
Updated 27 Nov 2026
Most websites, including WordPress, Joomla, Laravel and custom PHP apps, keep their content in a MySQL database. You need three things: a database, a user, and the user's permission on that database. cPanel's wizard does all three.
Create it with the wizard
- Open Services, choose your hosting and press Login to cPanel.
- Under Databases, open Database Wizard.
- Step 1: type a name, for example
shop, and press Next Step. - Step 2: type a username, for example
shopuser. Press Password Generator, copy the password somewhere safe, and press Create User. - Step 3: tick ALL PRIVILEGES and press Next Step.
Done. Note that cPanel adds your cPanel username in front of both names:
| What | Example |
|---|---|
| Database name | cpuser_shop |
| Database user | cpuser_shopuser |
| Password | the one you generated |
| Host | localhost |
Connect your website
Use the full prefixed names and host localhost.
WordPress (wp-config.php):
define( 'DB_NAME', 'cpuser_shop' );
define( 'DB_USER', 'cpuser_shopuser' );
define( 'DB_PASSWORD', 'the-password' );
define( 'DB_HOST', 'localhost' );
Laravel (.env):
DB_CONNECTION=mysql
DB_HOST=localhost
DB_DATABASE=cpuser_shop
DB_USERNAME=cpuser_shopuser
DB_PASSWORD=the-password
Import an existing database
- In cPanel, open phpMyAdmin.
- Click your database on the left.
- Open the Import tab, choose your
.sql(or.sql.zip) file and press Import.
Very large files can time out. Open a ticket and we'll import it for you.
"Error establishing a database connection"
This almost always means one of the four values is wrong. Check the prefix on the names, that the user was added to the database (cPanel › MySQL Databases › Add User To Database), and the password.
Stuck? Open a ticket and choose Technical. Our team can do it for you. Not hosting with us yet? See our cPanel hosting plans.