the detailed steps for removing anonymous users in MySQL are as follows:
[[Email protected] ~] #mysql-u root-p← log in with root via password
Enter password:← the password here
Welcome to the MySQL Monitor. Commands End With; or \g.
Your MySQL Connection ID is 7 to server version:4.1.20
Type ' help ', ' or ' \h ' for help. Type ' \c ' to clear the buffer.
Mysql>select user,host from Mysql.user; ← Viewing user Information
+------+----------------------------+
| user | Host |
+------+----------------------------+
| | localhost |
| Root | localhost |
| | sample.centospub.com |
| Root | sample.centospub.com |
+------+----------------------------+
4 rows in Set (0.02 sec)
Mysql> Delete from mysql.user where user= '; ← Deleting anonymous users
Query OK, 2 rows affected (0.17 sec)
Mysql> select User,host from Mysql.user; ← Viewing user Information
+------+----------------------------+
| user | Host |
+------+----------------------------+
| Root | localhost |
| Root | sample.centospub.com |
+------+----------------------------+
2 rows in Set (0.00 sec)
mysql> exit← exit MySQL server
Bye
This article from the "12259248" blog, reproduced please contact the author!
How MySQL removes anonymous users (improves security)