How to Create a MySQL Database in cPanel

A MySQL database is used to store and manage website data. Applications such as WordPress, Joomla, and many PHP-based websites use MySQL databases to store posts, users, settings, and other information.

Step 1: Login to cPanel

  1. Open your cPanel login page
  2. Enter your cPanel Username and Password, then click Log in.

Step 2: Open MySQL Databases

  1. After logging in to cPanel, locate the Databases section.
  2. Depending on your cPanel version, look for:
    MySQL® Databases
    or:
    Manage My Databases
  3. Click the available database management option.

Step 3: Create a New Database

  1. Find the Create New Database section.
  2. Enter a name for your database.
    For example:
    dbname
  3. Your complete database name may include your cPanel account username as a prefix.
    For example:
    dbname
  4. Click Create Database

Step 4: Confirm the Database Was Created

  1. After clicking Create Database, cPanel should display a success message.
  2. Return to the database management page.
  3. Your newly created database should now appear in the list of existing databases.

How to Create a MySQL Database User

Creating the database alone isn’t enough for most websites. You normally also need a database user with permission to access it.

Step 5: Create a New Database User

  1. Find the MySQL Users or Add New User section.
  2. Enter a username.
  3. For example: username
  4. Your complete database username may look like:
  5. cpanel_username

Create a strong password.

  • Uppercase letters
  • Lowercase letters
  • Numbers
  • Special characters

Then click: Create User

How to Add the User to the Database

Step 6: Select the User and Database

  1. Find the section:
  2. Add User To Database
  3. For example: cpaneluser_wpuser
  4. Then select your database: cpaneluser_wordpress
  5. Click: Add

Step 7: Assign Database Privileges

  1. After adding the user, cPanel will display the available database privileges.
  2. For a website that requires full database access, you may need to select
  3. ALL PRIVILEGES
  4. Then click: Make Changes
  5. Only grant the privileges required by the application you’re configuring.

Step 8: Note Your Database Details

  1. Your website or application will normally require four database details:
  2. Database Name: dbname
  3. Database Username: cpanel_username
  4. Database Password: The password you created
  5. Database Host: localhost

On many standard cPanel hosting environments, the database host is localhost, but you should use the hostname specified by your hosting provider if it is different.

Similar Posts