当前位置: 移动技术网 > IT编程>数据库>Mysql > Mysql允许外网访问设置步骤

Mysql允许外网访问设置步骤

2017年12月12日  | 移动技术网IT编程  | 我要评论

小屯村,小梅的兽交,老师灌学生堕胎药

1、打开mysql.exe(mysql command line client),输入密码

2、输入:use mysql;

3、查询host输入: select user,host from user;

4、创建host(如果有"%"这个host值,则跳过这一步)

如果没有"%"这个host值,就执行下面这两句:

mysql> update user set host='%' where user='root';
mysql> flush privileges;

5、授权用户

(1)任意主机以用户root和密码pwd连接到mysql服务器

mysql> grant all privileges on *.* to 'root'@'%' identified by 'pwd' with grant option;
mysql> flush privileges;

(2)指定ip为(如192.168.1.100)的主机以用户tuser和密码tpwd连接到mysql服务器

mysql> grant all privileges on *.* to 'tuser'@'192.168.1.100' identified by 'tpwd' with grant option; 
mysql> flush privileges;

以上所述是小编给大家介绍的mysql允许外网访问设置步骤,希望对大家有所帮助

如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复

相关文章:

验证码:
移动技术网