Knowledge base article

Search the support library or follow the guide below.

Step-by-step guidance

How to Add a User to a Database and Set Privileges in cPanel

A database and a database user can both exist without being connected. Assign the user to the intended database, then grant the operations that the application needs. Permissions apply to that user-database relationship, so changing access to one database should be a deliberate choice.

Older interfaces label Manage My Databases as MySQL Databases. The underlying user assignment and privilege steps are the same task.

Before you start

  • Create the database and database user first. Record their complete names, including any cPanel account prefixes.
  • Check the application's installation or upgrade requirements. Use only the required privileges; select All Privileges for this database only when the application needs them.

Instructions

  1. Open database management

    In cPanel, open Databases, then Manage My Databases. Scroll to Add User To Database.

  2. Choose the correct pair

    Select the existing user from User and the target database from Database. Compare both full names with your application's configuration before clicking Add.

  3. Choose permissions

    On the privileges screen, select the operations required by the application. For example, read-only reporting and an application installer may need different permissions.

  4. Save the assignment

    Click Make Changes and wait for the confirmation. Return to Current Databases and check that the intended username is listed for the database.

  5. Review an existing assignment

    To change privileges later, click the assigned username for that database in Current Databases. Adjust the selected permissions and save with Make Changes.

Check the result

  • Test the application action that needed access, such as loading content, saving a record, or running an authorized upgrade.
  • Confirm you edited the intended database's assignment and did not remove access needed by another application.

Troubleshooting

Access denied continues.
Verify the full username, password, database name, and host. Then confirm that this exact user is assigned to this exact database.
Reading works but saving or upgrading fails.
Review the application's required privileges and the exact database error. Add the specific missing permissions rather than changing unrelated account access.

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