← cPanel Hosting

Creating a MySQL database and user

Create a database, add a dedicated user and assign the privileges an application needs.

Most CMS and ecommerce applications store content and settings in a MySQL/MariaDB database. cPanel separates the database from the database user, and the user must be granted privileges before an application can connect.

Step by step

  1. Open the MySQL Databases interface or Database Wizard.
  2. Create a database with a descriptive name.
  3. Create a separate database user with a strong generated password.
  4. Add that user to the database and grant the privileges the application requires; many CMS installations need All Privileges.
  5. Enter the resulting database name, username, password and localhost host value into the application configuration.
Important

Do not reuse your cPanel login password as a database password. Database names and users may automatically receive your cPanel username as a prefix.

Checks and troubleshooting

If an application reports access denied, verify the full prefixed username/database name and confirm the user is actually assigned to that database.