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
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.
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.
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.
Create the user
Click Create User and wait for confirmation. Use Go Back and find the complete username in Current Users.
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
- How to Create a MySQL or MariaDB Database in cPanel
- How to Add a User to a Database and Set Privileges in cPanel