mysql设置只能指定范围IP访问
grant all privileges on *.* to root@"192.168.1.0/255.255.255.0" identified by '12345678' with grant option;
FLUSH PRIVILEGES;
ip地址例子:
192.0.0.0/255.0.0.0(192 A类网络的任何地址)
192.168.0.0/255.255.0.0(192.168 A类网络的任何地址)
192.168.1.0/255.255.255.0(192.168.1 C类网络的任何地址)
192.168.1.1(只有该IP)