首先,连接阿里云主机并登录数据库,
1、添加一个Host
mysql>select User,Password,Host from mysql.user;
insert into user (User,Password,Host)values(‘root‘,password(‘root‘),‘%‘);
2、为‘%‘添加权限
[mysql]> grant all privileges on *.* to ‘root‘@‘%‘ identified by ‘root‘;
3、刷新权限
[mysql]> flush privileges
//以前的解决方案到这就结束了,但通过navicat依然连接不上。
4、在阿里云上配置安全组规则
原文:https://www.cnblogs.com/123hll/p/11452106.html