mysql 远程访问问题

阿里云安装了 mysql

访问不了原因排查

首先检查阿里云是否有 3306端口,没有的话请自行添加。

#######登陆服务器######

###登陆数据库#########

use mysql
select host,user from user;

 

可以看到  如果远程 通过 ip 访问的话,必定失败,因为 host=localhost

操作修改如下

update user set host='%' where user = 'root';

 

 当 host=root 时 就可以远程用ip 访问了。

 

posted on 2021-03-13 16:44  不知所以随风飘动  阅读(49)  评论(0编辑  收藏  举报

导航