linux mysql远程连接

客户端服务器mysql连接其他服务器mysql的时候报以下错误:

ERROR 2049 (HY000): Connection using old (pre-4.1.1) authentication protocol refused (client option 'secure_auth' enabled)

输入命令查看

#mysql --help|grep secure-auth

secure-auth                       TRUE

异常原因在于服务器端的密码管理协议陈旧,使用的是旧有的用户密码格式存储;但是客户端升级之后采用了新的密码格式。mysql5.6版本遇到这种不一致的情况就会拒绝连接。

也就是客户端和服务端的mysql版本不一致.

解决办法:

客户端连接时off掉secure_auth,即连接时加上--secure_auth=off,如:mysql -p10.51.1.11 -P3308 -uroot --secure_auth=off

原文地址:https://www.cnblogs.com/blueskycc/p/5127081.html