Knowledge base article

Search the support library or follow the guide below.

Step-by-step guidance

How to Create a Database User in cPanel

A database user is the credential your application uses to connect to MySQL or MariaDB. It is separate from a cPanel login or email account. Creating the user is only the first part of setup: you must also assign it to a database and choose its permissions.

Manage My Databases appears as MySQL Databases on older cPanel versions. Username limits depend on the database server and configured prefix.

Before you start

  • Identify the database and application this user will serve. A dedicated user makes it easier to understand and limit that application's access.
  • Have a password manager ready. Use cPanel's database interface to create the user, rather than phpMyAdmin, so account ownership is managed correctly.

Instructions

  1. Open user management

    Sign in to cPanel and open Databases, then Manage My Databases. Find the database users section and its Add New User controls.

  2. Choose a username

    Enter a descriptive username and follow the length rules shown by cPanel. If an account prefix appears before the field, let cPanel add it automatically.

  3. Set a strong password

    Enter and confirm a unique password or use Password Generator. Save the result securely before continuing; cPanel does not display an existing database user's password later.

  4. Create the user

    Click Create User and wait for confirmation. Use Go Back and find the complete username in Current Users.

  5. Assign the user to a database

    Under Add User To Database, select the new user and the intended database, then click Add. Choose the application's required privileges and save with Make Changes.

Check the result

  • Confirm the full username is listed and appears as a privileged user for the correct database.
  • Enter the full username, password, database name, and confirmed database host in your application, then test its connection.

Troubleshooting

The username is too long.
Shorten the part you enter and account for any prefix. Limits vary between MySQL and MariaDB, so use the interface's validation guidance.
The user exists but cannot connect.
Check the full prefixed username, password, assigned database, and privileges. A user listed under Current Users may not yet be assigned to any database.

Watch the video

The video may show an older interface. Use the written instructions above when screen names differ.

Continue with a related task

Official documentation