数据库远程连接配置

首先,连接阿里云主机并登录数据库,

1、添加一个Host    ***注意这里数据库为mysql5.7或以上password字段修改成了authentication_string;

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