1 log in to MySQL
Mysql-h host-u username-p Password
2 Switch to MySQL library
use MySQL;
3 View currently allowed login IP and user
Select Host,userfromuser;
4 Remove unnecessary IP and users that exist in the table
DELETE from User WHERE User = ' username ' and Host='host';
(The host value of "%" or null means that all IPs can be logged in, generally such lines need to be deleted)
5 Increase the need for IP and users that are not in the table
GRANT All Privileges on *. * to ' username '@'host'by'password' with GRANT OPTION;
6 making the updated configuration effective
privileges;
Description
1. The host,username and password in the statement are modified according to the actual situation, the host name is IP or the hostname written to the Hosts file, in 4 and 5 can also be an IP segment, such as "192.168.220.0/255.255.255.0".
2. The whitelist restricts the "ip/User/password" group that can connect to the database, does not have the ability to connect to the database in the whitelist, and does not get banner information, so the scanner scan can be circumvented (the vulnerability is not really fixed).
MySQL Setup white list tutorial