How to create a MySQL database in cPanel

A site needs three things: a database, a database user and the user's privileges on that database. In cPanel the names start with a prefix - the account name and _.

1. Database

  1. Open "Manage My Databases" (group "Databases").
  2. In "New Database", enter a name, for example shop.
  3. Click "Create Database".
Creating a database
Creating a database

2. User

  1. Below, in "Add New User", enter a name, for example shop.
  2. Set a password or click "Password Generator". Save the password.
  3. Click "Create User".
Creating a database user
Creating a database user

3. Privileges

  1. In "Add User To Database", select the user and the database.
  2. Click "Add".
Linking the user and the database
Linking the user and the database
  1. Check "ALL PRIVILEGES".
  2. Click "Make Changes".
User privileges on the database
User privileges on the database

In "Current Databases", the user now appears next to the database.

Database and its user
Database and its user

What to enter in the site settings

SettingValue
Database hostlocalhost
Database namefull, with prefix: example_shop
Userfull, with prefix: example_shop
Passwordthe database user's password

"Database Wizard" does the same step by step.

Database Wizard
Database Wizard
Questions and answers
localhost.
cPanel adds the account name to database and user names. Use the full name in the site settings.