How to create a MySQL database in cPanel
Help centreOn this page
This guide shows how to create a MySQL database and a user that can access it, ready for a website or app.
If you’re installing WordPress with Softaculous or WP Toolkit, you can skip this. The installer creates the database for you. See how to install WordPress.
Using the Database Wizard
The wizard takes you through each step in order.
- Log in to cPanel.
- In the Databases section, click Database Wizard.
- Type a name for the database and click Next Step. cPanel adds your account username to the front, so
shopbecomes something likecpuser_shop. - Create a database user. Enter a username and a strong password, then click Create User.
- On the privileges page, tick ALL PRIVILEGES unless your app’s instructions say otherwise.
- Click Next Step.
Write down the full database name, full username and password. Your app will ask for them. The database host is usually localhost.
Using Manage My Databases
If you’d rather do each part separately:
- In the Databases section, click Manage My Databases.
- Under Create New Database, enter a name and click Create Database.
- Further down, under Add New User, create a user with a strong password.
- Under Add User To Database, choose the user and the database, then click Add.
- Tick the privileges you need and click Make Changes.
Viewing your data
To look at tables, run queries or import a .sql file, go to the Databases section and click phpMyAdmin. Your databases are listed on the left.
If it doesn’t work
- Your app says it can’t connect. Check you used the full database name and username, including the prefix, and that the host is
localhost. - Access denied. The user may not be added to the database. Repeat the Add User To Database step.
- The import is too large for phpMyAdmin. Log in over SSH and import it with
mysql -u username -p databasename < file.sql, or split the file into smaller parts.
Still stuck? Open a support ticket and we’ll help.
Every plan has cPanel, free SSL, backups every six hours and free migration.