Solved

Database listing / Databases showing

Posted on 2002-06-25
10
415 Views
Last Modified: 2008-02-26
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?

Thanks,

Wim
0
Comment
Question by:Wimmeke
  • 3
  • 3
  • 2
  • +2
10 Comments
 
LVL 5

Expert Comment

by:kelfink
ID: 7108377
According to: http://www.mysql.com/doc/S/H/SHOW_DATABASE_INFO.html ,

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.
0
 
LVL 1

Author Comment

by:Wimmeke
ID: 7108980
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.
0
 
LVL 2

Expert Comment

by:vasan_sr
ID: 7109615
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.

regards
VasanS
0
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 
LVL 5

Expert Comment

by:kelfink
ID: 7111635
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?
0
 
LVL 1

Author Comment

by:Wimmeke
ID: 7112439
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?
0
 
LVL 8

Accepted Solution

by:
drittich earned 50 total points
ID: 7114047
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."
0
 
LVL 5

Expert Comment

by:kelfink
ID: 7114839
well done, drittich.  I only knew of the new privilege.  

Then again, my own databases only have one security user!
0
 
LVL 8

Expert Comment

by:drittich
ID: 7115055
Yeah, I have never actually needed it either!
0
 
LVL 1

Author Comment

by:Wimmeke
ID: 8206987
Sorry guys, forgot about this question :-$

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

Thanks

Wim
0
 

Expert Comment

by:philcartmell
ID: 8647416
Hi,

I am running mysql v4.0.12 and revoke show databases from x doesnt see to work. any ideas?
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
understanding output of mysql version 2 65
Mysql sync between 3-4 mysql db 4 42
UPDATE query not working in mysqli php 8 60
MS SQL Update query with connected table data 3 34
Foreword In the years since this article was written, numerous hacking attacks have targeted password-protected web sites.  The storage of client passwords has become a subject of much discussion, some of it useful and some of it misguided.  Of cou…
Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question