Free migrationUK web hosting from £2.99 a month, with backups every six hours and a 60-day money-back guarantee.UK web hosting from £2.99 a month.See hosting plans

How to create a MySQL database in cPanel

On 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.

  1. Log in to cPanel.
  2. In the Databases section, click Database Wizard.
  3. Type a name for the database and click Next Step. cPanel adds your account username to the front, so shop becomes something like cpuser_shop.
  4. Create a database user. Enter a username and a strong password, then click Create User.
  5. On the privileges page, tick ALL PRIVILEGES unless your app’s instructions say otherwise.
  6. 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:

  1. In the Databases section, click Manage My Databases.
  2. Under Create New Database, enter a name and click Create Database.
  3. Further down, under Add New User, create a user with a strong password.
  4. Under Add User To Database, choose the user and the database, then click Add.
  5. 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.

Still stuck? Open a support ticket from your client area. Tell us your domain and which step went wrong, and we'll take it from there.
UK cPanel hosting from £2.99 a month

Every plan has cPanel, free SSL, backups every six hours and free migration.

See web hosting
Open in new tab