How to Create a MySQL Database in cPanel

13 views · Apr 16, 2026

Creating a MySQL Database in cPanel

Most PHP applications (WordPress, Joomla, custom apps) require a MySQL database. Here's how to create one.

Steps

  1. Log in to cPanel.
  2. Under Databases, click MySQL Databases.
  3. Under Create New Database, enter a name for your database (e.g., mysite) and click Create Database. The full name will be prefixed with your cPanel username (e.g., username_mysite).
  4. Scroll down to MySQL Users. Enter a username and a strong password, then click Create User.
  5. Under Add User to Database, select the user and database you just created, then click Add.
  6. On the privileges page, click All Privileges then Make Changes.

Connecting Your App to the Database

Use the following connection details in your application's config file:

  • Host: localhost
  • Database: cpanelusername_dbname
  • Username: cpanelusername_dbuser
  • Password: the password you set

Managing with phpMyAdmin

In cPanel, click phpMyAdmin under Databases to visually browse and manage your database tables, run SQL queries, import/export data, and more.