Bug #881 SHOW DATABASES works athough new mysql database set properly
Submitted: 21 Jul 2003 8:29 Modified: 22 Jul 2003 2:25
Reporter: Vladimir Trebicky Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:4.0.13 OS:Linux (Linux)
Assigned to: CPU Architecture:Any

[21 Jul 2003 8:29] Vladimir Trebicky
Description:
I've migrated from 3.25 to 4.0.13 and have problems with privilegies. I hope it must be some king of bug.

First what I noticed was that SHOW DATABASES showed everything athough the user hasn't any privilegies.
Then I read about migrating to 4.0 and tried the mysql_fix_privilege_tables. It produces many Duplicated and Unknown errors and did not fix the tables properly (PhpMyAdmin still warned that the privilege tables are not conforming to current mysql version)
So I looked into mysql_fix_privilege_tables source code and did all of those changes manually. Didn't help. I compared all of .frm files in my mysqld with those .frm files in standard instalation. There were two byte differences in user.frm. Now the user.frm is the same as the one in standard distribution and nothing.

How to repeat:
SHOW DATABASES ;-)

Suggested fix:
I suggest that there is some bug in deciding wheter or not use the new type of privilege tables.

mysql_fix_privilege_tables isn't reliable and doesn't work properly.

There is no good way to debug this kind of error. I simply don't what to do when user can do SHOW DATABASES although he has Show_db_priv="N" in mysql/user table.
[22 Jul 2003 2:25] Alexander Keremidarski
Not enough information was provided for us to be able
to handle this bug. Please re-read the instructions at
http://bugs.mysql.com/how-to-report.php

If you can provide more information, feel free to add it
to this bug and change the status back to 'Open'.

Thank you for your interest in MySQL.

mysql_fix_privilege_tables works well if executed with proper privileges. So do manual executing of seuqence of queries in mysql_fix_privilege_table.

Warnings are normal and described in output message:

If your tables are already up to date or partially up to date you will
get some warnings about 'Duplicated column name'. You can safely ignore these!

"I suggest that there is some bug in deciding wheter or not use the new type
of privilege tables."

There is no such decision process. 4.0 expects its own privileges tables structure.
[23 Feb 2005 17:21] Mike Kent
I just updated to 4.0.23 from 4.23 and I find the Show Databases privilege is still alive for users even after running the mysql_fix_privilege_tables script. This is most evident in phpmyadmin where every user logging in can see the other databases, though not the tables and data except their own.

So I submit this is still a bug.