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
- Open Databases → MySQL Databases in cPanel.
- Scroll to "Add New User" (MySQL Users), enter a username and a strong password (use the generator), and click Create User.
- Scroll to "Add User To Database", select your user and the target database, and click Add.
- Grant privileges. For a normal website user tick ALL PRIVILEGES, then Make Changes.
- Note the credentials — remember the username and database name include your account prefix (youruser_).
- 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.