Managing database users and privileges
Add users to a database, choose privileges, use separate users per application, and remove access you no longer need.
On this page
Each database can have one or more users, and each user needs privileges on the database to use it.
Viewing users for a database
Open Account Manager › MySQL Management and select the database. Its users are listed with their privileges.
Adding a user
- In the database’s page, choose to create a new user or add an existing one.
- Enter the user name and password, or pick an existing user.
- Choose privileges.
- Save.
Choosing privileges
| Use | Privileges |
|---|---|
| A normal application (WordPress, most apps) | All privileges on its own database |
| A reporting tool that only reads | SELECT only |
| A migration tool | All, then remove the user when finished |
Applications create and change tables during updates, so restricting a normal app’s privileges usually breaks updates.
Good practice
- One user per application. If one app is compromised, the attacker can’t read the others’ databases.
- Remove users you’ve finished with, such as temporary migration or developer accounts.
- Never reuse database passwords elsewhere.
Access denied errors
Access denied for user 'acme_shop'@'localhost' means the name, password or privileges are wrong. Check the full prefixed user name, reset the password, and confirm the user is listed on the database. Database connection failed
Prefer to follow along?
- Create a database and connect an application to it
Beginner · 15 min
Looking for somewhere to run PHP and MySQL? Traxio’s PHP and MySQL hosting includes phpMyAdmin.
If it doesn’t work
These guides cover the most common problems, starting with what you can see. Or browse every fix for a common problem.
- phpMyAdmin won’t open, logs out or times outFix common phpMyAdmin problems: login loops, session expiry, blank pages, import timeouts and ‘max_input_vars’ warnings.
- “Error establishing a database connection” in WordPressFix WordPress’s database connection error: check wp-config.php credentials, database user permissions, the database host and damaged tables.
Common questions
What does “Access denied for user” mean?
The database username or password is wrong, or that user has no rights on that database. Check all three against DirectAdmin, remembering that database and usernames carry your account prefix — a missing prefix is the single most common cause.
Spotted something out of date or unclear? Tell us and we’ll fix it.