Bug #5794 5.0.1alpha has an error with users access
Submitted: 29 Sep 2004 7:59 Modified: 2 Jun 2005 21:13
Reporter: Deivis Jaksta Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S2 (Serious)
Version:5.0.1alpha OS:Windows (win2000)
Assigned to: Reggie Burnett CPU Architecture:Any

[29 Sep 2004 7:59] Deivis Jaksta
Description:
in 5.0.0 alpha I hadn seen this problem but in 5.0.1 it is...
I'm a beginner of MySQL server user and dont know it is a problem or not. but when I had a 5.0.0 server version the users has'nt the permisions for all DataBases. only root user has all access. but in 5.0.1 alpha version all users has access to all DB.
example:

C:\Documents and Settings\Administrator>c:\mysql\bin\mysql.exe -u root
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1 to server version: 5.0.0-alpha-nt

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> SET PASSWORD=PASSWORD('blablabla');
Query OK, 0 rows affected (0.05 sec)

mysql> CREATE DATABASE a;
Query OK, 1 row affected (0.02 sec)

C:\Documents and Settings\Administrator>c:\mysql\bin\mysql.exe -u adfasfd
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2 to server version: 5.0.0-alpha-nt

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> show databases;
+----------+
| Database |
+----------+
| test        |
+----------+
1 row in set (0.01 sec)

there is everithing fine. the usser adfasfd can't see all DB.

Now I done the same with 5.0.1 version and look whats happen...

C:\Documents and Settings\Administrator>c:\mysql\bin\mysql.exe -u root
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1 to server version: 5.0.1-alpha-nt

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> SET PASSWORD=PASSWORD('blablabla');
Query OK, 0 rows affected (0.08 sec)

mysql> CREATE DATABASE a;
Query OK, 1 row affected (0.02 sec)

mysql> exit
Bye

C:\Documents and Settings\Administrator>c:\mysql\bin\mysql.exe -u rsfgds
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2 to server version: 5.0.1-alpha-nt

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> show databases;
+----------+
| Database |
+----------+
| a            |
| mysql      |
| test        |
+----------+
3 rows in set (0.00 sec)

You see that the user dont have the permisions but see all created databases.
Its an error or not???

How to repeat:
find where lost this mistake.
[2 Oct 2004 3:19] MySQL Verification Team
Thank you for the bug report. The issue here is the initial privileges for the 
anonymous user on 5.0.1 (how is showed at the bottom) regarding
the initial privileges on 5.0.0
Notice however that this behavior is with a fresh install with users
privileges that should be modified according with the instructions:

http://dev.mysql.com/doc/mysql/en/User_Account_Management.html

then please configure your server according the instructions indicated
in the chapter above.

c:\mysql\bin>mysql -uroot mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2 to server version: 5.0.1-alpha-nt

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> show grants for ""@"localhost";
+-----------------------------------------------------------------+
| Grants for @localhost                                           |
+-----------------------------------------------------------------+
| GRANT ALL PRIVILEGES ON *.* TO ''@'localhost' WITH GRANT OPTION |
+-----------------------------------------------------------------+
1 row in set (0.00 sec)

c:\mysql\bin>mysql -uroot
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1 to server version: 5.0.0-alpha-nt

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> show grants for ""@"localhost";
+--------------------------------------+
| Grants for @localhost                |
+--------------------------------------+
| GRANT USAGE ON *.* TO ''@'localhost' |
+--------------------------------------+
1 row in set (0.08 sec)
[16 Feb 2005 16:30] Ingo Strüwing
I cannot reproduce it on Linux with version 5.0.3-alpha-debug.
[2 Jun 2005 21:13] Reggie Burnett
Thank you for taking the time to report a problem.  Unfortunately
you are not using a current version of the product your reported a
problem with -- the problem might already be fixed. Please download
a new version from http://www.mysql.com/downloads/

If you are able to reproduce the bug with one of the latest versions,
please change the version on this bug report to the version you
tested and change the status back to "Open".  Again, thank you for
your continued support of MySQL.

Additional info:

This bug was the result of improper grant privileges in a very old version of 5.0.  Current 5.0.6 version does not show this problem.