A database user needs an explicit assignment to the database it will access. Privileges determine whether it can read rows, change data or alter table structure. Granting access to one database does not need to expose every database in the hosting account.
IN THIS ARTICLE
What you need before you begin
Create the database and user first. Check the application’s required permissions and record the existing assignment before changing it. Installers and upgrades may need broader permissions than a read-only reporting tool.
01 Assign a database user and choose its privileges in cPanel
- Open Manage My Databases and find Add User to Database. Select the full user and database names, including their prefixes.
- Choose Add to open the privileges screen. Select the permissions required by this application and save with the displayed confirmation control.
- Use All Privileges only when the application genuinely requires full control of that database, such as an installer that creates and alters its own tables.
- For an existing assignment, open its privileges management action to review or change access. Do not remove permissions from a shared credential without checking every application that uses it.
- Update the application configuration if the username changed and test its relevant operations.
Confirm the expected result
Check both reading and saving data. A homepage that loads may not exercise the privileges needed for administration, scheduled jobs or an application update.
How do I distinguish a password error from missing database privileges?
An access-denied error can mean the wrong password, the wrong database or missing privileges. Distinguish authentication failure from a rejected SQL operation. If a change breaks the application, restore the previous known assignment while reviewing the minimum correct permissions instead of creating multiple unknown users.