MySQL database GRANT~ about the authorization of the authorized IP side

Enter MYSQL database
use mysql

Add authorized 192.168.*.* user root to access all server databases;
grant all privileges on *.* to'root'@'192.168.%.%' identified by'pure111@111' with grant option;

Refresh execution
flush privileges;

Check the information (is it OK)
select Host,User from user;

GRANT ALL PRIVILEGES ON *.* TO 'root'@'120.111.%.%' IDENTIFIED BY 'pure111@1119' WITH GRANT OPTION;
GRANT ALL PRIVILEGES ON *.* TO 'root'@'202.111.%.%' IDENTIFIED BY 'pure111@111' WITH GRANT OPTION;
GRANT ALL PRIVILEGES ON *.* TO 'root'@'202.111.111.111' IDENTIFIED BY 'pure111@111' WITH GRANT OPTION;

Show database name
show databases;

show tables;

 

MySQL authorizes user login ip segment

172.16.1.0/24

GRANT ALL PRIVILEGES ON *.* TO test@'172.16.1.%' identified by 'test123456' 即可。

172.16.0.0/16

GRANT ALL PRIVILEGES ON *.* TO test@'172.16.%' identified by 'test123456' 即可。

MySQL authorization method for a certain type (a certain field opened) database

Databases beginning with bbs_

grant all on `bbs_%`.* to test@'172.16.1.3' identified by 'test123456';

Guess you like

Origin blog.csdn.net/kakak2000/article/details/106252948