How to Manage MySQL User Privileges

Privileges decide what a MySQL user is allowed to do with a database. On shared hosting you manage them in cPanel – no SQL needed. On a VPS or dedicated server with root access, you can also use SQL commands. This guide covers both, starting with the cPanel way most people need. Every JetHost web hosting plan includes cPanel for managing database users.

On shared hosting: manage privileges in cPanel

Shared hosting has no root access, so you don’t use SQL to grant privileges – you do it through cPanel, which is simpler and safer. To give a user access to a database:

  1. Open Manage My Databases under the Databases section.
  2. Scroll to Add User To Database, choose the user and the database, and click Add.
  3. On the privileges screen, tick ALL PRIVILEGES (right for most apps) or just the ones you need, then click Make Changes.
Assign SQL privilegies

To change privileges later, click the user under the database in the Current Databases list, adjust the ticks, and save again.

Fixing “SELECT command denied to user”

This common error simply means the user isn’t allowed to read that database. On shared hosting the fix is the steps above: open Manage My Databases, make sure the user is added to the database under Add User To Database, and grant ALL PRIVILEGES. That restores the missing SELECT permission – no SQL required.

Check what access a user has

In Manage My Databases, the Current Databases table shows each database with its assigned users under Privileged Users – the quickest way to confirm who has access. If you prefer SQL, you can connect as your own user over SSH or in phpMyAdmin’s SQL tab and run SHOW GRANTS; to list your own privileges.

On a VPS or dedicated server: SQL commands

With root access you can manage users and privileges directly in SQL. Connect as root:

mysql -u root -p

Grant a user full access to a database, then reload the privilege tables:

GRANT ALL PRIVILEGES ON database_name.* TO 'user'@'localhost';
FLUSH PRIVILEGES;

Other useful root commands: list every user with SELECT DISTINCT User, Host FROM mysql.user;, inspect one user’s access with SHOW GRANTS FOR 'user'@'localhost';, and fix a “SELECT denied” error with GRANT SELECT ON database_name.* TO 'user'@'localhost';.

JetHost Experts Tip

On shared hosting, always use cPanel for privileges – trying to run GRANT or read the mysql.user table will simply fail, because those need root access you don’t have on a shared plan. The SQL section above applies only to a VPS or dedicated server.

Need more help?

Not sure which privileges a user needs, or seeing an access error you can’t clear? Open a ticket through Client Area → Support Tickets and our team will sort it out.