Details
-
Bug
-
Status: Closed (View Workflow)
-
Minor
-
Resolution: Not a Bug
-
5.5(EOL), 10.0(EOL), 10.1(EOL), 10.2(EOL), 10.3(EOL), 10.4(EOL)
-
None
Description
Anonymous users have been removed:
MariaDB [test]> select user, host from mysql.user; |
+------+-----------+ |
| user | host | |
+------+-----------+ |
| root | 127.0.0.1 |
|
| root | ::1 |
|
| root | localhost |
|
| root | ws |
|
+------+-----------+ |
4 rows in set (0.00 sec) |
and the server knows they don't exist:
MariaDB [test]> set password for '' = password('test'); |
ERROR 1133 (28000): Can't find any matching row in the user table |
but RENAME or DROP still works:
MariaDB [test]> rename user '' to foo; |
Query OK, 0 rows affected (0.03 sec) |
nothing of course appears in mysql.user:
MariaDB [test]> select user, host from mysql.user; |
+------+-----------+ |
| user | host | |
+------+-----------+ |
| root | 127.0.0.1 |
|
| root | ::1 |
|
| root | localhost |
|
| root | ws |
|
+------+-----------+ |
4 rows in set (0.00 sec) |
It happens because there is some contents in mysql.db (and it remains there even when anonymous users get dropped):
before RENAME |
MariaDB [test]> select user, host from mysql.db; |
+------+------+ |
| user | host | |
+------+------+ |
| | % |
|
| | % |
|
+------+------+ |
2 rows in set (0.00 sec) |
after RENAME |
MariaDB [test]> select user, host from mysql.db; |
+------+------+ |
| user | host | |
+------+------+ |
| foo | % |
|
| foo | % |
|
+------+------+ |
2 rows in set (0.00 sec) |
Now we can work the same way on user foo, etc.
It appears strange. I suppose it was meant to be so once, but I'm not sure it still is.