Managing database users and privileges

Add users to a database, choose privileges, use separate users per application, and remove access you no longer need.

How-to guideIntermediate2 min readUpdated

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 then MySQL Management and select the database. Its users are listed with their privileges.

Adding a user

  1. In the database’s page, choose to create a new user or add an existing one.
  2. Enter the user name and password, or pick an existing user.
  3. Choose privileges.
  4. Save.

Choosing privileges

UsePrivileges
A normal application (WordPress, most apps)All privileges on its own database
A reporting tool that only readsSELECT only
A migration toolAll, 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

Looking for somewhere to run PHP and MySQL? Traxio’s free PHP MySQL hosting includes phpMyAdmin and is free for your first 30 days.

Popular

Tip: press / to search from any pageSee all results