Database listing / Databases showing

Hi all,

This is probably something very basic, but I really don't see how to accomplish it.

I have a MySQL server with multiple databases on it, with multiple users. Every user has full control over it's own databases and is denied access to the others.

However, when someone connects to the server, he/she can list all other databases on the system. Since these are clients, obviously, I do not want them to see the other databases.

Is there a way to prevent this?


Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

According to: ,

In version 4.02, a SHOW DATABASES permission will be necessary to show a database, unless the use has some other permission on that database.
WimmekeAuthor Commented:
I have version 4.1.2 but I cannot find this option anywhere. Thing is ... all users only have read-rights on their databases and no rights at all on other databases.

So I guess this means that the SHOW DATABASES permission is loaded by default when creating a database. I tried a revoke, but seems not to work.
u can set the permission in the mysql database.

mysql> show databases;
mysql> use mysql

This has 6 tables...wherein we can set the permissions.

10 Tips to Protect Your Business from Ransomware

Did you know that ransomware is the most widespread, destructive malware in the world today? It accounts for 39% of all security breaches, with ransomware gangsters projected to make $11.5B in profits from online extortion by 2019.

I meant mysql version 4.0.2.  Is there a beta of 4.1.2 available already, or are you talking about some other software?
WimmekeAuthor Commented:
Sorry, you're right. I gave you the version number of PHP instead of MySQL ... anyways, I have version 3.23.39 :-)

So I guess there's no way to accomplish this with my current version? Or is there?
I believe you can start MySQL with this option:

mysqld --safe-show-database

"With this option, the SHOW DATABASES command returns only those databases for which the user has some kind of privilege. From version 4.0.2 this option is deprecated and doesn't do anything (the option is enabled by default) as we now have the SHOW DATABASES privilege."

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
well done, drittich.  I only knew of the new privilege.  

Then again, my own databases only have one security user!
Yeah, I have never actually needed it either!
WimmekeAuthor Commented:
Sorry guys, forgot about this question :-$

I will close it now and award the point to drittich. This is indeed the solutions.



I am running mysql v4.0.12 and revoke show databases from x doesnt see to work. any ideas?
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
MySQL Server

From novice to tech pro — start learning today.