Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a client that wants to use myphpadmin to manage his mysql database 5.x on my server. I found this article on how to hide databases from myphpadmin but I don't like this because if I don't specify the databases to hide then every time I add a new database it because available to the client through myphpadmin.


Command to hide a database in the myphpadmin file:

 $cfg['Servers'][$i]['hide_db'] = 'hidedb1|hidedb2|etc...';

I also created a separate username and password in mysql to.

Is there a way to reverse this so I can tell myphpadmin what database to only show for this login?


Frank G.

share|improve this question
up vote 2 down vote accepted

MySQL user will see only the databases on which he has access right. You can test it

mysql> create database test_db;
mysql> grant all privileges on test_db.* to test_user@'%' identified by "password";

After that login with test_user and you will see only test_db database

What do I do if the user has three database that are already populated. How do I give him just access to those three?

first of all revoke all privileges

mysql> flush privileges;

and then grant to necessary db/tables/columns

share|improve this answer
What do I do if the user has three database that are already populated. How do I give him just access to those three? – Frank G. Aug 3 '13 at 18:58
okay I create a test db called "test123" and then I did the grant all priv to user test_user with the password set to password. Then I tried to login to phpmyadmin and it wont let me. I know the db is there and the user I see both. I also removed the phpmyadmin config file so that wont cause problems. But still wont let me in. Any suggestions? – Frank G. Aug 3 '13 at 19:08
well that was educational. I figured it out and that is very helpful for future things like this so a big thank you to you for your help!!!! Thanks! – Frank G. Aug 3 '13 at 19:15
You can see all privileges with "SHOW GRANTS FOR 'user'@'host';" – ALex_hha Aug 3 '13 at 19:18
A typical mysql user should have access for insert/update/delete records from db, for e.g wordpress user. If you have some special requirements then you should split the access, imho – ALex_hha Aug 4 '13 at 9:39

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.