Create a MySQL database and user in cPanel
Most dynamic sites (WordPress, stores, custom apps) need a database to store content, orders and users.
Steps
- Log in to cPanel and open MySQL Databases (or the Database Wizard).
- Under Create New Database, enter a name and create it.
- Under MySQL Users, add a user with a strong password.
- Under Add User To Database, pick the user and database and click Add.
- Tick ALL PRIVILEGES and save.

Using it in your site
In your config file (such as wp-config.php or .env) use:
- Database and user names: the full names shown in cPanel, usually prefixed with your account name and an underscore.
- Host:
localhostin most cases.
Ready-to-copy examples (replace the names and password with yours):
// wp-config.php (WordPress)
define( 'DB_NAME', 'account_dbname' );
define( 'DB_USER', 'account_dbuser' );
define( 'DB_PASSWORD', 'your-strong-password' );
define( 'DB_HOST', 'localhost' );
# .env (Laravel and most PHP frameworks)
DB_CONNECTION=mysql
DB_HOST=localhost
DB_PORT=3306
DB_DATABASE=account_dbname
DB_USERNAME=account_dbuser
DB_PASSWORD=your-strong-password
To import an existing database, use phpMyAdmin → Import.
For large databases, if SSH is enabled, importing from the command line is faster and more reliable:
# Import a .sql file over SSH (faster than phpMyAdmin for large databases)
mysql -u account_dbuser -p account_dbname < backup.sql
Was this article helpful?