The method of MySQL restricting the range of IP Network Segment from remote access
Mysql > grant select,insert,update,create on test.* to test@'192.168.8.%' identified by '123456'
Mysql > grant select,insert,update,create on test.* to test@'192.168.9.%' identified by '123456'
Mysql > grant select,insert,update,create on test.* to test@'192.168.20.%' identified by '123456'
The above statement authorizes all permissions of the test database to the test user, only allows the test user to log in remotely in the IP range of the three network segments 192.168.8 and 920, and sets the password of the test user to 123456
Refresh the permissions table to make its settings take effect:
Mysql > flush privileges