Economicalhost · Knowledge Base
Knowledge Base › Databases › How to Create a Database User and Assign Privileges
Databases

How to Create a Database User and Assign Privileges

A database needs a user with privileges before an application can connect. You can create users separately and attach them to any database.

Step-by-step

  1. Open Databases → MySQL Databases in cPanel.
  2. Scroll to "Add New User" (MySQL Users), enter a username and a strong password (use the generator), and click Create User.
  3. Scroll to "Add User To Database", select your user and the target database, and click Add.
  4. Grant privileges. For a normal website user tick ALL PRIVILEGES, then Make Changes.
  5. Note the credentials — remember the username and database name include your account prefix (youruser_).
  6. Use them in your app config with host = localhost — see finding the database name.

💡 Good to know

  • Create one dedicated user per application for cleaner security and easier management.
  • Both username and database name carry the youruser_ prefix — include it in configs.
  • Reset a user's password from the same page if an app's connection fails.