NetPoa

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

  1. Open Services, choose your hosting and press Login to cPanel.
  2. Under Databases, open Database Wizard.
  3. Step 1: type a name, for example shop, and press Next Step.
  4. Step 2: type a username, for example shopuser. Press Password Generator, copy the password somewhere safe, and press Create User.
  5. 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

  1. In cPanel, open phpMyAdmin.
  2. Click your database on the left.
  3. 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.

Was this helpful?