create user youruser@'192.168.43.0/255.255.255.0' identified by 'password';
grant select,insert on lotus.pswddict to youruser@'192.168.43.0/255.255.255.0';
#修改远程连接用户的加密规则
ALTER USER youruser@'192.168.43.0/255.255.255.0' IDENTIFIED WITH caching_sha2_password BY 'password';#要用安全模式
show grants for youruser@'192.168.43.0/255.255.255.0';
select * from mysql.user;
flush privileges;
update mysql.user set host='192.168.43.0/255.255.255.0' where user='youruser'; #要用安全模式
revoke select,insert on lotus.pswddict from youruser@'192.168.43.0/255.255.255.0';
MYSQL授权指定局域网访问
于 2023-06-21 22:09:40 首次发布