ArchLinuxでMySQL5.5を使用して、パスワードを使用してlocalhostユーザーを作成し、すべてのテーブルにすべての権限を付与してからそのユーザーを削除すると、パスワードを入力しなくてもそのユーザーとしてログインできます。
再現する手順:
# mysql -u root -h localhost -p
Enter password: <root password>
mysql> create user 'test'@'localhost' identified by 'testing123';
mysql> grant all on *.* to 'test'@'localhost' identified by 'testing123';
mysql> select * from mysql.user where user='test';
1 row in set (0.00 sec)
mysql> exit
# mysql -u test -h localhost -p
Enter password: testing123
mysql> show databases;
mysql> exit
# mysql -u root -h localhost -p
Enter password: <root password>
mysql> delete from mysql.user where user='test';
Query OK, 1 row affected (0.00 sec)
mysql> FLUSH PRIVILEGES;
mysql> select * from mysql.user where user='test';
Empty set (0.00 sec)
mysql> exit
# mysql -u test -h localhost
mysql> (Why?)
それだけでなく、「存在しない」テストユーザーは引き続き同じ特権をすべて行使できます。主要なセキュリティ問題。サーバーを再起動しても、パスワードなしでログインできます。