How to Create a MySQL Database User in cPanel

After creating a MySQL database in cPanel, you need to create a database user and assign it to the database before your application can connect. Database users have their own username and password credentials, separate from your cPanel login. This guide walks you through creating a user and granting it access to a database.

Steps to Create a Database User

  1. Log in to your cPanel account.
  2. In the Databases section, click MySQL Databases.
  3. Scroll down to the MySQL Users section.
  4. Under Add New User, enter a Username for the database user. Keep it short and relevant to your project.
  5. Enter a strong Password. Use the password generator if you need help creating a secure one.
  6. Click Create User.

About the Username Prefix

Just like database names, cPanel automatically adds your cPanel username as a prefix to database usernames. For example, if your cPanel username is johndoe and you enter wpuser, the full username will be johndoe_wpuser. Use this full username when configuring your application's database connection settings.

Assigning the User to a Database

After creating the user, you must assign it to a database and grant permissions:

  1. Scroll down to the Add User to Database section on the MySQL Databases page.
  2. Select the User and the Database from the respective dropdowns.
  3. Click Add.
  4. On the next page, choose the privileges to grant. For most web applications, select All Privileges.
  5. Click Make Changes.

Connecting Your Application

When setting up your application (for example, during a WordPress installation), you will need:

  • Database Host: localhost
  • Database Name: Full prefixed name (e.g., johndoe_mysite)
  • Database Username: Full prefixed username (e.g., johndoe_wpuser)
  • Password: The password you set

If you need assistance setting up database users or connecting an application, contact our support team and we will help you get things running.

100% Satisfaction Guarantee

We're so confident you'll love dotCanada that we offer a 30-day money-back guarantee. Not satisfied? Get a full refund, no questions asked.

Ready to Get Started?

Join thousands of Canadian website owners who trust dotCanada for reliable, fast web hosting.

Get Started Today