mysql数据库如何赋予远程某个IP 访问权限

2019-11-21 来源: 琵琶树 发布在  https://www.cnblogs.com/lfl17718347843/p/11907555.html

1.授权用户root使用密码jb51从任意主机连接到mysql服务器:

代码如下:

GRANT ALL PRIVILEGES ON *.* TO 'ROOT'@'%' IDENTIFIED BY 'jb51' WITH GRANT OPTION;
flush privileges;

2.授权用户root使用密码jb51从指定ip为218.12.50.60的主机连接到mysql服务器:

代码如下:

GRANT ALL PRIVILEGES ON *.* TO 'ROOT'@'218.12.50.60' IDENTIFIED BY 'jb51' WITH GRANT OPTION;
flush privileges;

相关文章