手机
当前位置:查字典教程网 >编程开发 >mysql数据库 >mysql_connect(): Connection using old (pre-4.1.1) authentication protocol refused
mysql_connect(): Connection using old (pre-4.1.1) authentication protocol refused
摘要:做了一下mysql升级,开发机上mysql升级到5.6版本,结果连接一些低版本的mysql服务器报出如下异常:Warning:mysql_c...

做了一下mysql升级,开发机上mysql升级到5.6版本,结果连接一些低版本的mysql服务器报出如下异常:

Warning: mysql_connect(): Connection using old (pre-4.1.1) authentication protocol refused (client option 'secure_auth' enabled)

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

详见mysql手册“Server Command Options”一节中“--secure-auth"选项的说明:http://dev.mysql.com/doc/refman/5.6/en/server-options.html#option_mysqld_secure-auth

解决方法有如下三种:

1、服务器端升级启用secure_auth选项;

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

3、找到对应的mysql用户把密码改为新的加密方式,PASSWORD(‘your password'),如:

复制代码 代码如下:SET PASSWORD FOR root=PASSWORD('123456');

对于方法二,使用在程序做相应mysql配置即可,以php为例,在php.ini中设置secure_auth=off

【mysql_connect(): Connection using old (pre-4.1.1) authentication protocol refused】相关文章:

mysql 日期和时间以及转换时间戳函数

php 不能连接数据库 php error Can't connect to local MySQL server

MYSQL命令行模式管理MySql的一点心得

Mysql中的count()与sum()区别详细介绍

mysql Out of memory (Needed 16777224 bytes)的错误解决

mysql 中文乱码 解决方法集锦

mysql "too many connections" 错误 之 mysql解决方法

mysql生成随机字符串函数分享

MySql 错误Incorrect string value for column

还原大备份mysql文件失败的解决方法分享

精品推荐
分类导航