パスワードを使用してlocalhostユーザーを作成し、すべてのテーブルにすべての権限を与えて削除すると、Arch LinuxでMySQL 5.5を使用しますパスワードを入力しなくてもそのユーザーとしてログインすることができます。再現するMySQLユーザーを削除すると、空のパスワードでそのユーザーとしてログインすることができます
ステップ:
# 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?)
それだけではなく、「存在しない」テストユーザーがまだ同じ権限のすべてを行使することができます。主なセキュリティ問題。サーバーを再起動しても、パスワードなしでログインできます。
' mysql.userから選択*ユーザーが表示されるかどうかそれは私のバグのように見えます。 –
"Empty set(0.00 sec)"が表示されています(上記の手順で試したときと同じ結果になります) – OCDev
MySQLを再起動しても、マシン全体を数回再起動しようとしました。すべての結果が同じです。 – OCDev