Bug #3342 SHOW CREATE DATABASE seems to require the DROP privilege
Submitted: 31 Mar 2004 6:37 Modified: 7 Apr 2004 6:59
Reporter: Antonio Bonifati Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:4.1.1-alpha OS:FreeBSD (FreeBSD 4.8-RELEASE)
Assigned to: Victor Vagin CPU Architecture:Any

[31 Mar 2004 6:37] Antonio Bonifati
Description:
I'm using phpMyAdmin-2.5.6 and when I login as user "testuser" that only has a select privilege on a database (and no global privilege) I get:

Error

SQL-query :  [Edit]

SHOW CREATE DATABASE `testdatabase` ;

MySQL said:
#1044 - Access denied for user: 'testuser'@'localhost' to database 'monitor'

I found that MySQL only allows the query above if the user has the DROP
privilege on the database "testdatabase". This looks like to me like a bug,
cause I don't want to grant the DROP privileges to users who only need
the select privilege.

How to repeat:
Try the query:

SHOW CREATE DATABASE `testdatabase` ;

as a user who only has the select privilege to the database "testdatabase"
[31 Mar 2004 15:17] Dean Ellis
Verified against 4.1.2.  Thank you.

cn1:
CREATE DATABASE d1;
GRANT SELECT ON d1.* TO test@localhost;

cn2: (test@localhost)
SHOW CREATE DATABASE d1;

cn1:
GRANT DROP ON d1.* TO test@localhost;

cn2:
SHOW CREATE DATABASE d1;
[6 Apr 2004 5:39] Victor Vagin
subj: bk commit - 4.1 tree (vva:1.1771) BUG#3342

ChangeSet
  1.1771 04/04/06 20:26:35 vva@eagle.mysql.r18.ru +3 -0
  fixed 
  bug #3342 "SHOW CREATE DATABASE seems to require DROP privilege"
  (now it require only SELECT privilege on database)
[7 Apr 2004 6:59] Victor Vagin
Thank you for your bug report. This issue has been committed to our
source repository of that product and will be incorporated into the
next release.

If necessary, you can access the source repository and build the latest
available version, including the bugfix, yourself. More information 
about accessing the source trees is available at
    http://www.mysql.com/doc/en/Installing_source_tree.html

Additional info:

The fix will be in mysql-4.1.2