mysql外网无法连接问题

mySql安装好后,会出现本机可以访问,但是外部网络无法远程访问mysql数据库的问题。
解决办法:
   1). 以root登录到mysql: mysql -r root -p,输入密码
   2).use mysql:mysq是mysql安装后自带的系统库,权限用户等信息均存储在此处
1.直接改表法:
    1.update user set host='%' where user='root';
    2.FLUSH RIVILEGES;
2.赋权限:
    1.grant all privileges on *.* to 'root'@'%' identified by 'password' with grant option;
       这里是将所有的权限(all privileges on *.*)开放给所有('%')以‘’‘root’登录的IP
    2.  FLUSH PRIVILEGES

猜你喜欢

转载自blog.csdn.net/cpytiger/article/details/40511481
今日推荐