mysql设置外网访问

use mysql;
select
`host`,`user` from `user` update user set host = '%' where user ='enjoy'; flush privileges;

 如果以上操作完不行,那就检查一下mysqld.cnf(这个文件一般在etc/mysql/mysql.conf.d里面),把里面的

bind-address = 127.0.0.1

设置成bind-address = 0.0.0.0

然后重启mysql

/etc/init.d/mysql stop

/etc/init.d/mysql start

 

如果是windows直接去服务里面右键重启mysql的服务就行

posted @ 2017-12-11 18:23  wuyubing  阅读(352)  评论(0编辑  收藏  举报