52AV璈A|52AV.ONE

 曉撖蝣
 蝡唾酉
敹急瑕
  • av隢憯BBS
  • 璈A
  • 芣瑟憭瘚
  • 鞎澆
  • 52av鋆貉摰
  • 銝剜-銝剖銝餅
     
亦: 4918|敺: 0
銝銝銝駁 銝銝銝駁

[mysql] 閫瘙 php叮ysql隞孑ysqli_connect()蝑蝑航炊==>mysqlnd cannot connect to MySQL 4.1

[銴鋆賡包
頝唾唳摰璅撅
璅銝
潸” 2018-10-11 12:57:07 | 芰閰脖 撣 |摨閬 |梯璅∪
酥hp 5.5隞乩 銝 mysql 5.2 嚗叮ysql隞 mysqli_connect() Y航炊mysqli_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')." P( ]- L0 V. T: t

8 ]6 Z  M9 E% n+ G9 k. H臬歉hp 5.3隞亙撖蝣潭16雿蝺函Ⅳ,啁php 5.3隞亙41雿蝺函Ⅳ,mysql 5.2 隞亙閮凋16蝣,隞交甇斤車航炊.
# {. L# p- ]6 W5 Q  }0 B5 N閮箸瑚銝mysql: (php 5.6.38 , mysql 5.1.73)9 `1 o7 t+ s& i' G( `% s
餃叮ysql 嗅頛詨 : " o! q2 Q/ R0 J
mysql> SHOW VARIABLES LIKE 'old_passwords';# s: L* F8 @; h
+------------------+-------+
5 A7 V7 r3 h" i3 _8 g1 D| Variable_name | Value |% a+ Z9 B1 h* ~( e
+------------------+-------+- B' i: B( W8 U# z5 V% O+ P) l9 _! r# k+ P
| old_passwords | ON   |7 k* H5 Y( Y" E) y4 ~
+------------------+-------+
3 S1 E' b5 r& W0 a# t, b1 row in set (0.00 sec)7 b' m- q: C$ a
: f2 Z) j/ E7 U
old_password  ==> ON  撠梯”蝷 /etc/my.cnf  鋆 old_passwords=1  閮剖16蝣,撠摰閮剔 0 嗅mysqld ==> service mysqld restart, \: d- a" w" A( f3 t
mysql prompt銝頛詨:7 {5 t) x# y& _! F# O5 a
mysql> SET old_passwords=FALSE;  
# ~5 n/ I+ I/ Y2 u$ h$ E瑼X叮ysql.user 瘥撖蝣潮瑕漲:: q+ R9 b8 _& d4 K
mysql> SELECT 'User', 'Host', Length('Password') FROM mysql.user;
3 l7 \! Q3 k$ N, h3 D" J憒瘝寞41雿,Length('Password')甈雿閰脤賣160(銵函內瘝閮剖蝣) , o1 x; d" J) @& `" R* U

8 i. l$ B) D! Y( H! W$ U3 K閮剖靘撖蝣:9 l% _, O% Z* q3 }, n
mysql> SET PASSWORD FOR 'root'@'192.168.1.1' = PASSWORD('靘撖蝣');    // 撠敹閬詨靘 撣唾@IP 湔,銝閬寥臭  a) \6 D8 Y% w+ Z* C8 o! b
mysql> flush privileges;
) `& d! G" `8 y  T
/ a2 q' s, d7 k6 r$ H頛詨 SELECT 'User', 'Host', Length('Password') FROM mysql.user; 瑼X亙蝣澆漲,撠勗舐潛曉寧root 撖蝣潮瑕漲撌脫寧41蝣3 M, |2 q* t# g( [- i6 @% Z  Q) U
瘜冽:! l6 Z! X( T' f; U* @) D
憒撣唾憭芸,臭誑啣憿閮剖蝣,粹閮剖蝣 SET PASSWORD FOR 芷撠亙蝣,銝 old_passwords=0 撠撖蝣潮敶梢
===========================================================================
! p( ^6 L4 u9 x8 p  g* J鄉ysql蝝 8.0.21,php逅ysql箇2銵errors:
) q6 m1 V. }! x& z# s5 mmysqli_real_connect(): Server sent charset (255) unknown to the client. Please, report to the developers
  f2 }) e, P+ u% T2 V0 [mysqli_real_connect(): (HY000/2054): Server sent charset unknown to the client. Please, report to the developers
, ]- [% r+ A) R3 l  `- e:

, {3 o9 r9 @4 D* ^4 W3 {4 w! }, V決ySQL 8.0.21銝哨caching_sha2_password舫隤頨思遢撽霅隞塚銝臭誑敺mysql_native_password隞亙php銝詨捆臭誑蝝php嚗銋臭誑靽格遍ySQL蝵柴 曆犖瘙箏靽格遍ySQL蝵:. A/ q' @) x! u+ ?, b9 z
vi /etc/my.cnf  乩:
1 C( ]5 E- Q1 j[mysqld]
( A3 U: I* s) f
' ~2 G( [0 z7 @; s! z% [4 ~character-set-server=utf8
$ a5 ?5 ^& F* _  i4 _8 X, Tdefault_authentication_plugin=mysql_native_password
* J6 x  J3 {2 r) Q" y* v3 |1 z1 U; E" s+ _
[mysql]( r! u& z* S/ }0 O& I' p6 p( w
default-character-set=utf8
, v$ J. S" T/ z7 V4 n9 \6 g7 T% q% E) i! M7 u6 H
[client]
* l9 z( @3 Z1 Jdefault-character-set=utf8
8 X+ {% o! _8 {0 I# w! @0 B2 M# C6 M7 I# ^: L
嗅mysqld8 g4 `; D4 l# v4 R: Q
service mysqld restart
% j8 K/ i7 C& w' e- p' d摰!!: L/ D" H9 {) h" x& P' w
6 N3 Y0 `! K5 t# k- T8 [: M
" R6 p5 J1 `$ ~% ~- x8 |

雿輻券

祉蝛閬

砍憛批捆靘餉衣雯頝臬批捆蝝颲行粹嗥蝬脩嚗摰撟湔遛嚗嚗甇脖誑銝嗅啣摰嗆摰撟湧翩鈭箏ㄚ孵舫脣伐銝憿亙祉璇甈橘芣遛18甇 雓蝯脣亦閬賬粹脩芣遛18甇脖芣撟渡雯閬賜雯頝臭嗥批捆鞈閮嚗撱箄降典舫脰蝬脰楝批捆蝝蝯蝜ICRA蝝摰鋆閮剖 (粹蝯行霅 祉蝬脣銝蝝瘛函隢憯啣嚗祉閮剜蝞∠)

QQ|撠暺撅||52AV璈A

GMT+8, 2025-12-15 04:11 , Processed in 0.066212 second(s), 16 queries .

蝯∠.撱

[email protected] | QQ:2405733034     since 2015-01

鋆貉憒 敹恍敺 餈銵