【转】Warning: mysql_connect(): mysqlnd cannot connect to MySQL 4.1+ using the old insecure authenticat
Warning: mysql_connect(): mysqlnd cannot connect to MySQL 4.1+ using the old insecure authenticat
当mysql版本< 5.1时,php版本为>=5.3时,mysql_connect()会显示的是如下错误:
Warning: mysql_connect(): Premature end of data (mysqlnd_wireprotocol.c:554) in D:\WwwRoot\AutoDial\mysql_connect_test.php on line 7 Warning: mysql_connect(): OK packet 1 bytes shorter than expected in D:\WwwRoot\AutoDial\mysql_connect_test.php on line 7 Warning: mysql_connect(): mysqlnd cannot connect to MySQL 4.1+ using the old insecure authentication. Please use an administration tool to reset your password with the command SET PASSWORD = PASSWORD('your_existing_password'). This will store a new, and more secure, hash value in mysql.user. If this user is used in other scripts executed by PHP 5.2 or earlier you might need to remove the old-passwords flag from your my.cnf file
【解决方法】
1. 找到配置文件my.cnf(Linux,/etc/my.cnf)或my.ini(win,安装目录),打开,将其中old_passwords=1注释掉;
2.重启mysql;
3. 将mysql用户对应的密码重新设定一下(set password for 'user_test'@'{这里写你的地址}' = password('123456'))。
【原因】
有 的安装情况下,MySQL 5.0 为了和4.1之前的版本兼容,用户密码(mysql数据库的user表password字段)保存的是密码的16位hash值,而PHP5.3的 mysql驱动使用41位的密码hash值进行用户验证,所以需要让mysql中保存用户密码的41位hash值,但配置文件中 old_passwords=1的话,password()函数只能返回16位hash值。参考mysql5.0文档security章password hashing in mysql节。
转自:http://topic.csdn.net/u/20110306/12/d6f13885-da88-46c4-a37d-eae656bf65ca.html
【转】Warning: mysql_connect(): mysqlnd cannot connect to MySQL 4.1+ using the old insecure authenticat的更多相关文章
- 解决Mysql报错:PHP Warning: mysql_connect(): mysqlnd cannot connect to MySQL 4.1+ using the old insecure authentication.
最近我更新了appserv-win32-2.5.10的 PHP 5.2版本到PHP 5.3,在调用http://localhost/phpMyAdmin/时,出现如下错误:PHP Warning: ...
- mysqlnd cannot connect to MySQL 4.1+ using the old insecure authentication解决办法
mysqlnd是个好东西.不仅可以提高与mysql数据库通信的效率,而且也可以方便的设置一些超时.如,连接超时,查询超时.但是,使用mysqlnd的时候,有个地方需要注意.就是服务端的密码格式不能使用 ...
- mysqlnd cannot connect to MySQL 4.1+ using the old insecure authentication的解决方法
直接命令行操作没有问题,但是PHP连接就会报上面的错误. SET old_passwords =0; USE mysql; UPDATE user SET password =PASSWORD('yo ...
- mysqlnd cannot connect to MySQL 4.1+
phpMyAdmin - error #2000 - mysqlnd cannot connect to MySQL 4.1+ using the old insecure authenticatio ...
- 连接mysql问题 mysqlnd cannot connect to MySQL 4.1+ using old authentication
第一篇:PHP5.3开始使用MySqlND作为默认的MySql访问驱动,而且从这个版本开始将不再支持使用旧的用户接口链接Mysql了,你可能会看到类似的提示: #2000 - mysqlnd cann ...
- mysqlnd cannot connect to MySQL 4.1+ using old authentication
报这个错误主要是因为mysql使用了老的密码格式,而程序要求使用新的格式导致的,解决办法: SET old_passwords = 0; UPDATE mysql.user SET Password ...
- mysqlnd cannot connect 连接错误处理方法
mysqlnd cannot connect to MySQL 4.1+ using the old insecure authentication. Please use an administra ...
- phpmyadmin mysqlnd cannot connect to
mysqlnd cannot connect to MySQL 4.1+ using the old insecure authentication. Please use an administra ...
- php 5.3开始使用mysqlnd作为的默认mysql访问驱动
mysqlnd成为php 5.3中的默认mysql驱动,它有如下优点: mysqlnd更容易编译: 因为它是php源码树的一个组成部分 mysqlnd和php内部机制结合更紧密,是优化过的mysql驱 ...
随机推荐
- SURF算法与源码分析、上
如果说SIFT算法中使用DOG对LOG进行了简化,提高了搜索特征点的速度,那么SURF算法则是对DoH的简化与近似.虽然SIFT算法已经被认为是最有效的,也是最常用的特征点提取的算法,但如果不借助于硬 ...
- Spring的国际化资源messageSource
Spring中可以使用两个类加载资源文件:ReloadableResourceBundleMessageSource和ResourceBundleMessageSource. 可配置如下message ...
- D FFF团的怒火
Time Limit:1000MS Memory Limit:65535K 题型: 编程题 语言: 无限制 描述 在信软学院,男女比例失衡已经是习以为常的事情. 在这样的一个学院,诞生了一个神秘 ...
- sql 关联查询
SELECT mms_sample_datas.* from mms_sample_datas where mms_sample_datas.mms_id in ( SELECT mms_sample ...
- wp 处理方法
-DeepZoom:源于遥感影像的金字塔显示方式,提供了与高分辨率图像进行交互的能力,可以快速缩放图像而不影响应用的性能,加载或平移图像时可以光滑过度 -应用:高分辨率.极大图像的浏览,3D合成图像, ...
- FlyCapture2 VS2010 Configuration
Add in the system Path: C:\Program Files (x86)\Point Grey Research\FlyCapture2\bin Project->Proje ...
- 我装GitHub的过程
GitHub是老师推荐的没正真的使用过,这次安装也是按提示的,不知对否,且还没使用,只是记录一下自己的过程.我是在线安装的. 1.下载GitHub安装问价,双击开始安装 2.出现的可能是系统相关配置吧 ...
- mysql 和字符串截取相关的知识点
LOCATE(',','123,456') - 1) SELECT LEFT('123,456',3); SELECT LEFT('123,456',LOCATE(',','123,456') - 1 ...
- OS | 哲学家问题
哲学家进餐问题: (1) 在什么情况下5 个哲学家全部吃不上饭?考虑两种实现的方式,如下:A.算法描述: void philosopher(int i) {/*i:哲学家编号,从0 到4*/ whil ...
- 找到n中最小的k个数
题目:n个数中,求最小的前k个数. 这道题在各个地方都看到过,在国内出现的频率也非常高. 面完阿里回来听说这道题又被考了,所以还是决定回来写一写,对于这种高频题...顺便再吐槽一下阿里的面试,我竟然一 ...