Skip to main content

Creating a MySQL database in cPanel

Updated May 21, 2026

You need a MySQL database for most apps (WordPress, Laravel, custom PHP).

Step 1 — create the database

  1. cPanel → MySQL Databases.
  2. Under Create New Database, enter a name (e.g. mysite) and click Create Database.
  3. The full name will be youruser_mysite (cPanel adds your username as a prefix). Note it down.

Step 2 — create a database user

  1. Scroll to MySQL Users → Add New User.
  2. Pick a username and a strong password (or click Password Generator).
  3. Click Create User. Note the full username (also prefixed).

Step 3 — give the user access

  1. Scroll to Add User To Database.
  2. Pick the user and the database, click Add.
  3. On the privileges page, tick ALL PRIVILEGES and save.

Your connection details

  • Host: localhost
  • Database: the prefixed name (e.g. youruser_mysite)
  • Username: the prefixed user name
  • Password: what you just set

To import an existing .sql file, open phpMyAdmin from cPanel, click your database in the left sidebar, then Import.

Was this article helpful?