国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 數據庫 > MySQL > 正文

解決mysqlnd cannot connect to MySQL 4.1+ using the old insec

2024-07-24 12:39:54
字體:
來源:轉載
供稿:網友

解決mysqlnd cannot connect to MySQL 4.1+ using the old insecure authentication錯誤.

mysqlnd比mysql說使用起來更方便了,但小編在使用時碰到mysqlnd cannot connect to MySQL 4.1+ using the old insecure authentication錯誤了,下面我們一起來看此問題解決辦法.

mysqlnd是個好東西,不僅可以提高與mysql數據庫通信的效率,而且也可以方便的設置一些超時,如連接超時,查詢超時.

但是,使用mysqlnd的時候,有個地方需要注意,就是服務端的密碼格式不能使用舊的16位的存儲格式,而要使用新的41位的存儲格式.

如果服務端的密碼格式是16位,那么就會報錯,信息如下:

  1. Fatal error: Uncaught exception ‘PDOException’ with message ‘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’ in /home/hailong.xhl/test.php:8 --Vevb.com 

如何查看自己的密碼是否符合要求,so easy.

  1. mysql> select user,length(passwordfrom mysql.user;  
  2. +--------------+------------------+ 
  3. user         | length(password) | 
  4. +--------------+------------------+ 
  5. | demo         |               16 |  
  6. | demo         |               16 |  
  7. +--------------+------------------+ 

上面的密碼是舊的16位格式,如果想改成新的41位格式,通過以下命令就可以.

  1. mysql>UPDATE mysql.user SET Password = PASSWORD('demo'WHERE user = 'demo'
  2. Query OK, 2 rows affected (0.00 sec) 
  3. Rows matched: 2  Changed: 2  Warnings: 0 
  4. mysql> select user,length(passwordfrom mysql.user
  5. +--------------+------------------+ 
  6. user         | length(password) | 
  7. +--------------+------------------+ 
  8. | demo         |               41 |  
  9. | demo         |               41 |  
  10. +--------------+------------------+ 
  11. mysql> flush privileges
  12. Query OK, 0 rows affected (0.00 sec) 

修改完密碼后,還需要在配置文件中修改下old_passwords選項,把值設置為0,即.

old_passwords=0 然后重啟mysql.

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 宿州市| 周至县| 泾源县| 安达市| 策勒县| 乌苏市| 天等县| 驻马店市| 武夷山市| 达孜县| 南安市| 洮南市| 荔波县| 梧州市| 新泰市| 布尔津县| 绥滨县| 兴海县| 潢川县| 潜山县| 平阳县| 淳化县| 敦煌市| 内乡县| 普宁市| 漯河市| 怀来县| 那坡县| 治多县| 屏山县| 晴隆县| 织金县| 清新县| 恩平市| 赤峰市| 黎平县| 加查县| 乐都县| 米林县| 左贡县| 伊宁县|