navicat连接mysql服务端报10060错误解决过程如下
1、授权远程登录权限
mysql> update user set Host='%' where User = 'root';
Query OK, 1 row affected (0.00 sec)
Rows matched: 1 Changed: 1 Warnings: 0
flush privileges; 刷新权限
2、如果还连接不上,需要防火墙开启3306端口,阿里云上也需要开启允许连接3306端口
详细参考之前访问tomcat的配置
如果服务器安装的是8.0的数据库,连接时会出现Client does not support authentication protocol requested by server;
原因:
mysql8 之前的版本中加密规则是mysql_native_password,而在mysql8之后,加密规则是caching_sha2_password,
解决方法:.把mysql用户登录密码加密规则还原成mysql_native_password.
更新用户的密码
alter user 'root'@'localhost' identified with mysql_native_password by '123456'
-> ;
Query OK, 0 rows affected (0.01 sec)
刷新权限:
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)