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

首頁 > 數據庫 > MySQL > 正文

mysqlnd cannot connect to MySQL 4.1+ using the old insecure authentication

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

文章介紹了關于mysqlnd cannot connect to MySQL 4.1+ using the old insecure authentication方法,有需要了解的同學可參考一下.

  1. Warning: mysql_connect() [function.mysql-connect]: Premature end of data (mysqlnd_wireprotocol.c:554) in path/to/the/file/where/connection/script/is/written/ 
  2.  
  3. Warning: mysql_connect() [function.mysql-connect]: OK packet 1 bytes shorter than expected in path/to/the/file/where/connection/script/is/written/ 
  4. --Vevb.com 
  5. Warning: mysql_connect() [function.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 in path/to/the/file/where/connection/script/is/written/ 

1.Change MySQL to NOT to use old_passwords 

It seems that even MySQL 5.x versions still default to the old password hashes. You need to change this in “my.cnf” (e.g. /etc/my.cnf): remove or comment out the line that says:

  1. old_passwords = 1 
  2.  // 
  3. old_passwords = 1為16位 
  4. //所以這里要先 
  5. /SET old_passwords = 0; 
  6. //這樣使新密碼的長度也變成41位 
  7. Restart MySQL. If you don’t, MySQL will keep using the old password format, which will mean that you cannot upgrade the passwords using the builtin PASSWORD() hashing function. You can test this by running: 

具體原因我還不是很清楚,跟old密碼長度有關?先記錄下來,日后研究,解決方法如下:

  1. SET old_passwords = 0; 
  2. UPDATE mysql.user SET PASSWORD = PASSWORD'm.survivalescaperooms.com' ) WHERE User = 'chajian8' LIMIT 1 ; 
  3. SELECT LENGTH( PASSWORD ) FROM mysql.user WHERE User = 'chajian8'
  4. FLUSH PRIVILEGES ; 

附,PHP連接MySQL測試代碼:

  1. <?php 
  2. $con = mysql_connect("192.168.3.240:3306","chajian8",m.survivalescaperooms.com); 
  3. if (!$con)  
  4.  die('Could not connect: ' . mysql_error()); 
  5. ?>

發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表
主站蜘蛛池模板: 同德县| 无棣县| 兴山县| 大同县| 临安市| 泰安市| 明光市| 广灵县| 迁西县| 合山市| 鲁山县| 浦县| 会泽县| 德清县| 库尔勒市| 青神县| 文安县| 祥云县| 鄂尔多斯市| 林西县| 青海省| 兰西县| 信宜市| 北流市| 昔阳县| 福建省| 西峡县| 泽库县| 林周县| 澄江县| 城固县| 收藏| 新营市| 故城县| 达孜县| 阜阳市| 湘潭县| 乌审旗| 义乌市| 沂源县| 梁平县|