如何用grant命令来授权指定ip

2025-03-29 21:19:52
推荐回答(1个)
回答1:

使用以下授权语句,将授权指定的192.168.1.1 和192.168.1.2 的机器,使用用户名为root,密码为test123的用户访问
grant all privileges on *.* to 'root'@'192.168.1.1' identified by 'test123';
grant all privileges on *.* to 'root'@'192.168.1.2' identified by 'test123';