52AV璈A|52AV.ONE

 曉撖蝣
 蝡唾酉
敹急瑕
  • av隢憯BBS
  • 璈A
  • 芣瑟憭瘚
  • 鞎澆
  • 52av鋆貉摰
  • 銝剜-銝剖銝餅
     
亦: 5150|敺: 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').2 R, Z2 W+ q/ J: P2 H: o$ f
2 X6 ^+ Q6 {6 [0 N6 ]% S) ?
臬歉hp 5.3隞亙撖蝣潭16雿蝺函Ⅳ,啁php 5.3隞亙41雿蝺函Ⅳ,mysql 5.2 隞亙閮凋16蝣,隞交甇斤車航炊.# e% }% p- q7 M" `
閮箸瑚銝mysql: (php 5.6.38 , mysql 5.1.73)! }( i& N& `  p
餃叮ysql 嗅頛詨 :
3 n; c% |9 @1 Lmysql> SHOW VARIABLES LIKE 'old_passwords';* p0 N2 O$ h! q' H
+------------------+-------+9 p: q9 L0 ]& W5 Y: Z6 k) H
| Variable_name | Value |+ \, ~8 W* D+ A
+------------------+-------+5 z2 _! l0 T4 \1 Y8 i; ^
| old_passwords | ON   |6 R: r5 r# F8 x$ Q9 r/ b# U+ ]9 `, }
+------------------+-------+
3 f4 x' r& ~! Q1 row in set (0.00 sec)9 e; T: _% c' B2 p8 ], b! @; r

1 R1 O$ a8 w7 s6 e: r% @- dold_password  ==> ON  撠梯”蝷 /etc/my.cnf  鋆 old_passwords=1  閮剖16蝣,撠摰閮剔 0 嗅mysqld ==> service mysqld restart
2 f, h$ a/ G, V9 n* ]' S+ H mysql prompt銝頛詨:
* {" d& c1 f/ mmysql> SET old_passwords=FALSE;  ! r) _4 g4 E1 v
瑼X叮ysql.user 瘥撖蝣潮瑕漲:4 W0 O& H! ]7 x
mysql> SELECT 'User', 'Host', Length('Password') FROM mysql.user;
4 _6 I: E  J9 K9 B% I, a憒瘝寞41雿,Length('Password')甈雿閰脤賣160(銵函內瘝閮剖蝣)
) L1 T+ i; p/ o
# ^1 c) v' H5 ]) A9 G5 a% r閮剖靘撖蝣:! M2 @6 J# F( o- C* g
mysql> SET PASSWORD FOR 'root'@'192.168.1.1' = PASSWORD('靘撖蝣');    // 撠敹閬詨靘 撣唾@IP 湔,銝閬寥臭
- Z) a2 g& f2 E" c  Q, p# `- i6 Gmysql> flush privileges;
1 X$ u& V5 z! R# n1 d& l1 Q
  r  \; f: }9 n3 Y$ C" |) E+ k0 }  b  |頛詨 SELECT 'User', 'Host', Length('Password') FROM mysql.user; 瑼X亙蝣澆漲,撠勗舐潛曉寧root 撖蝣潮瑕漲撌脫寧41蝣; w/ D( T0 c; c' E- c* i$ q) z
瘜冽:
0 N$ O% V! }) Y, C: N+ \( U0 q$ V憒撣唾憭芸,臭誑啣憿閮剖蝣,粹閮剖蝣 SET PASSWORD FOR 芷撠亙蝣,銝 old_passwords=0 撠撖蝣潮敶梢
===========================================================================
1 h  ^2 [6 i% |7 `% c+ u, d鄉ysql蝝 8.0.21,php逅ysql箇2銵errors:
# o1 m1 w5 u6 omysqli_real_connect(): Server sent charset (255) unknown to the client. Please, report to the developers; u' i* I% N6 p; S
mysqli_real_connect(): (HY000/2054): Server sent charset unknown to the client. Please, report to the developers
: w9 u* V5 b- p' \:
8 @( U( Z1 N% K, u/ z% i
決ySQL 8.0.21銝哨caching_sha2_password舫隤頨思遢撽霅隞塚銝臭誑敺mysql_native_password隞亙php銝詨捆臭誑蝝php嚗銋臭誑靽格遍ySQL蝵柴 曆犖瘙箏靽格遍ySQL蝵:4 q2 b+ R) n+ \& Z7 z! v6 z8 r4 N
vi /etc/my.cnf  乩:$ ]4 p$ s% q: n6 \6 E
[mysqld]
& @2 |  U* M8 G( S: }
8 W* p* O- D0 i- S! y6 c" J% Xcharacter-set-server=utf8
2 i4 h5 V; t% b4 {1 ]- }( Ndefault_authentication_plugin=mysql_native_password
) X2 c/ v% \$ V, @& J; d: X6 @( H/ R! K2 {5 M; z7 j
[mysql]
  ?- p# N9 c* b  y' d  X- u# qdefault-character-set=utf8
8 \$ h& d7 {- V; U/ T: E4 S( z& ^/ C  G, Q0 U; ~% n- e
[client]1 k4 P; X6 Q! s+ k
default-character-set=utf8
4 E& Y; t" i) g
, N, ]* B+ p( B4 ?+ I嗅mysqld
8 L, ]: L) N" ]service mysqld restart
2 h' T+ }& U& I4 E: ?- M$ E摰!!
- Y7 E. Y8 `2 h( ~' Q

  b. l; ~1 ~. \4 n! P/ E/ b
2 J7 l1 K# |' k% B4 b& U

雿輻券

祉蝛閬

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

QQ|撠暺撅||52AV璈A

GMT+8, 2026-3-30 08:56 , Processed in 0.066205 second(s), 16 queries .

蝯∠.撱

52avtv@gmail.com | QQ:2405733034     since 2015-01

鋆貉憒 敹恍敺 餈銵