Bug #4242 No users in user table in 4.1.2a
Submitted: 22 Jun 2004 2:29 Modified: 25 Jun 2004 12:36
Reporter: Hayk Rachidian Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S1 (Critical)
Version:4.1.2a OS:Windows (Windows 2000)
Assigned to: Michael Widenius CPU Architecture:Any

[22 Jun 2004 2:29] Hayk Rachidian
Description:
Here is the problem

mysql> select user from user;
+------+
| user |
+------+
|      |
+------+
1 row in set (0.00 sec)

When I remove anonymous user I can not login as root.
I can not even change root's password via set password.

mysql> delete from user where user = '';
Query OK, 1 row affected (0.05 sec)

mysql> set password = PASSWORD('mysql');
ERROR 1133 (42000): Can't find any matching row in the user table
mysql>
mysql>  select host, user from mysql.user;
Empty set (0.00 sec)
mysql>
mysql> flush privileges;
Query OK, 0 rows affected (0.07 sec)

mysql> exit
Bye

C:\mysql\bin>mysql -uroot
ERROR 1130 (HY000): Host 'localhost' is not allowed to connect to this MySQL server

C:\mysql\bin>

I have same 4.1.2a version on linux, no problems there.
What is going on with Windows version?
Thanks,
-Hayk

 

How to repeat:
mysql> delete from user where user = '';
Query OK, 1 row affected (0.05 sec)

mysql> set password = PASSWORD('mysql');
ERROR 1133 (42000): Can't find any matching row in the user table
mysql>
mysql>  select host, user from mysql.user;
Empty set (0.00 sec)
mysql>
mysql> flush privileges;
Query OK, 0 rows affected (0.07 sec)

mysql> exit
Bye

C:\mysql\bin>mysql -uroot
ERROR 1130 (HY000): Host 'localhost' is not allowed to connect to this MySQL server

C:\mysql\bin>

Suggested fix:
I think the user table population script is missing, because Linux version of same 4.1.2a has no problems.
[22 Jun 2004 3:11] Hayk Rachidian
Here is what I tried. Copied user table from 4.1.1a to 4.1.2a.
No I got all users in place

mysql> select user from user;
+-------------+
| user        |
+-------------+
| root        |
| root        |
+-------------+
2 rows in set (0.01 sec)

mysql>

Now, the question is can we do this way? If we can why do not publish new download file with the users fixed from Linux.
[22 Jun 2004 4:45] MySQL Verification Team
Thank you for the bug report. Yes the current workaround is to
use the grant tables from 4.1.1a in Windows.
[25 Jun 2004 12:36] Michael Widenius
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:

Added missing root user to the windows source installation (which is used to make the binary builds)
Fix will be in 4.1.3