国产欧美日韩第一页|日本一二三不卡视频|在线精品小视频,亚洲第一免费播放区,metcn人体亚洲一区,亚洲精品午夜视频

幫助中心 >  技術(shù)知識(shí)庫(kù) >  網(wǎng)站相關(guān) >  程序開(kāi)發(fā) >  遇到“mysqlnd cannot connect to MySQL 4.1+ using old insecure authentication....”的解決辦法

遇到“mysqlnd cannot connect to MySQL 4.1+ using old insecure authentication....”的解決辦法

2017-01-15 02:16:26 1291

在安裝phpthink時(shí)報(bào)錯(cuò)

SQLSTATE[HY000] [2000] 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

原因:使用高版本mysql數(shù)據(jù)庫(kù)導(dǎo)入了低版本數(shù)據(jù)引起的,其中高版本數(shù)據(jù)庫(kù)的password hashes 是41位的hashes,而低版本數(shù)據(jù)庫(kù)的數(shù)據(jù)存儲(chǔ)的root 的password是16位的hashes,需要修改user表的password字段數(shù)據(jù)為41為的hashes。

解決辦法:

use mysql;    // 進(jìn)入存儲(chǔ)user表的數(shù)據(jù)庫(kù)

set session old_passwords=0;   //修改session使用41位hashes(16為1,41的為0)

select password('root');   //查看你的password函數(shù)是否可以生成41位的hashes

set password for 'root' @'localhost' = password('root');   //使用password函數(shù)修改你的root密碼為41的hashes


提交成功!非常感謝您的反饋,我們會(huì)繼續(xù)努力做到更好!

這條文檔是否有幫助解決問(wèn)題?

非常抱歉未能幫助到您。為了給您提供更好的服務(wù),我們很需要您進(jìn)一步的反饋信息:

在文檔使用中是否遇到以下問(wèn)題: