52AV璈A|52AV.ONE

 曉撖蝣
 蝡唾酉
敹急瑕
  • av隢憯BBS
  • 璈A
  • 芣瑟憭瘚
  • 鞎澆
  • 52av鋆貉摰
  • 銝剜-銝剖銝餅
     
亦: 4900|敺: 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').4 Y4 y6 q% f; E) m- W
' R( A4 ~! x/ d, {3 d
臬歉hp 5.3隞亙撖蝣潭16雿蝺函Ⅳ,啁php 5.3隞亙41雿蝺函Ⅳ,mysql 5.2 隞亙閮凋16蝣,隞交甇斤車航炊.
& n6 n7 b, U8 J( [" E7 y7 q/ d# F閮箸瑚銝mysql: (php 5.6.38 , mysql 5.1.73)6 Y# N: ], e6 @& |; V1 K
餃叮ysql 嗅頛詨 : 5 n: W3 h9 B6 ^  }$ t8 i& L( \
mysql> SHOW VARIABLES LIKE 'old_passwords';, n# x& W: N  O# V
+------------------+-------+( @/ D. ?. J4 R! H: y9 Y' b& l  B
| Variable_name | Value |
- N! t) x9 E* R1 v* a; |+------------------+-------+. ]3 Z" U. ]9 v- u3 u
| old_passwords | ON   |
/ n9 ~3 Z/ @5 x6 S- L+------------------+-------+
5 j" i/ v" ~( \1 row in set (0.00 sec)
. P& Y/ I) c% Y) c3 M5 L% {+ J
0 _# P4 d$ G8 Yold_password  ==> ON  撠梯”蝷 /etc/my.cnf  鋆 old_passwords=1  閮剖16蝣,撠摰閮剔 0 嗅mysqld ==> service mysqld restart0 m5 X. _) M9 F; M. |* F$ ?
mysql prompt銝頛詨:1 r6 ?, @7 ?! m: d( Z% v7 ^  r
mysql> SET old_passwords=FALSE;  + G  q# D' x) V* Y  A
瑼X叮ysql.user 瘥撖蝣潮瑕漲:+ `, ^. }5 d- x9 T) J1 k8 r" r6 Y
mysql> SELECT 'User', 'Host', Length('Password') FROM mysql.user;
3 V$ V" @, [+ ^- o5 R! c; s" R憒瘝寞41雿,Length('Password')甈雿閰脤賣160(銵函內瘝閮剖蝣)
4 f5 d: u" v8 r7 I  r( a6 P# t8 t: w# T+ E9 m* m- e
閮剖靘撖蝣:
4 F  L" U; L$ W$ hmysql> SET PASSWORD FOR 'root'@'192.168.1.1' = PASSWORD('靘撖蝣');    // 撠敹閬詨靘 撣唾@IP 湔,銝閬寥臭
2 y# b' K3 E! F' l% R! Omysql> flush privileges;. v3 I& @" n2 b$ _" g
! p: M/ d) _4 E
頛詨 SELECT 'User', 'Host', Length('Password') FROM mysql.user; 瑼X亙蝣澆漲,撠勗舐潛曉寧root 撖蝣潮瑕漲撌脫寧41蝣
- U# A2 @. K7 G# t8 g) D0 J1 N9 K瘜冽:
& y' s+ H3 |( O6 g+ t憒撣唾憭芸,臭誑啣憿閮剖蝣,粹閮剖蝣 SET PASSWORD FOR 芷撠亙蝣,銝 old_passwords=0 撠撖蝣潮敶梢
===========================================================================
, a. n) q4 z  x% P! ^/ ]鄉ysql蝝 8.0.21,php逅ysql箇2銵errors:9 ?  ^+ ?4 [3 W
mysqli_real_connect(): Server sent charset (255) unknown to the client. Please, report to the developers
, T0 B1 {0 s4 jmysqli_real_connect(): (HY000/2054): Server sent charset unknown to the client. Please, report to the developers4 w6 ^8 z/ B4 `
:
* X2 x: ~7 m3 P- {7 a9 \
決ySQL 8.0.21銝哨caching_sha2_password舫隤頨思遢撽霅隞塚銝臭誑敺mysql_native_password隞亙php銝詨捆臭誑蝝php嚗銋臭誑靽格遍ySQL蝵柴 曆犖瘙箏靽格遍ySQL蝵:
8 Y  t7 H8 e, b* a8 J2 ]vi /etc/my.cnf  乩:; E* R5 T6 ~1 C
[mysqld]
1 b: D8 C! X5 s9 Y- P9 B" ^8 F8 }
character-set-server=utf8' i5 b# U* V, f
default_authentication_plugin=mysql_native_password
  \' D! D; m2 U' @3 Q  P( \0 {+ P9 r( n1 Z/ K' B
[mysql]) l8 k4 t6 J" W( m
default-character-set=utf8
+ x" C+ v$ z: C- N" [+ @7 Y4 t- G. o6 w4 H
[client]
* W4 B& x6 J% s" [* \3 [+ x' @default-character-set=utf8
$ h3 c: y  B& U- ^/ {5 w' S# B! \2 ^* z, j8 O9 [
嗅mysqld
5 g. N6 T/ A; E  V" f/ n0 k  Tservice mysqld restart( w2 R  ~$ G0 H+ L3 }; w6 a0 z
摰!!
# g1 {8 t4 T/ C% h* y
+ H) `+ y% H, W+ `2 g- m

: y# R* a. h4 O: A  h) R4 u0 f7 n) A

雿輻券

祉蝛閬

撠蝝詨

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

QQ|撠暺撅||52AV璈A

GMT+8, 2025-12-6 07:09 , Processed in 0.064786 second(s), 16 queries .

蝯∠.撱

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

鋆貉憒 敹恍敺 餈銵