52AV璈A|52AV.ONE

 曉撖蝣
 蝡唾酉
敹急瑕
  • av隢憯BBS
  • 璈A
  • 芣瑟憭瘚
  • 鞎澆
  • 52av鋆貉摰
  • 銝剜-銝剖銝餅
     
亦: 5137|敺: 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').
% J, d1 M) w* w" L* O+ z6 o+ d+ y& n2 R3 Z% @
臬歉hp 5.3隞亙撖蝣潭16雿蝺函Ⅳ,啁php 5.3隞亙41雿蝺函Ⅳ,mysql 5.2 隞亙閮凋16蝣,隞交甇斤車航炊.
( j7 w/ U# F* {9 N$ ]閮箸瑚銝mysql: (php 5.6.38 , mysql 5.1.73)
4 A: H$ `' S" v" {5 b6 t+ f/ Q餃叮ysql 嗅頛詨 :
1 o$ K. N3 A$ J+ X( `mysql> SHOW VARIABLES LIKE 'old_passwords';
$ }. T  f$ A2 X+------------------+-------++ p3 r) `5 A' Q
| Variable_name | Value |
5 R8 P7 P8 Y. v% q+ r1 \) ~! l2 s+------------------+-------+: I7 B) ?# N- @& q( }4 h
| old_passwords | ON   |3 g. y% y' ]5 u' |
+------------------+-------+
7 j- e0 g8 M7 C: `; ?6 F1 row in set (0.00 sec)
; i7 M; _8 }9 ^# K! r, V
/ ~+ g* W: d* S9 l$ B& `# i# v0 I8 |' t- Vold_password  ==> ON  撠梯”蝷 /etc/my.cnf  鋆 old_passwords=1  閮剖16蝣,撠摰閮剔 0 嗅mysqld ==> service mysqld restart: ~1 M5 x/ f, f3 A# |: v
mysql prompt銝頛詨:
" f) H3 ?, Z8 X1 B' y. I5 Z& qmysql> SET old_passwords=FALSE;  
$ y8 c& C3 Q" w* j% B8 _( Q" I& E6 }瑼X叮ysql.user 瘥撖蝣潮瑕漲:( {, _9 b7 m! g1 r9 }
mysql> SELECT 'User', 'Host', Length('Password') FROM mysql.user;) `3 e3 s0 J8 |8 |6 Z: J
憒瘝寞41雿,Length('Password')甈雿閰脤賣160(銵函內瘝閮剖蝣)
& v1 v; q" ^* M/ A# g: J6 u/ J! I; z3 ^2 t1 }! |( W3 _- F
閮剖靘撖蝣:& x* d& p( T, x' I& q/ W
mysql> SET PASSWORD FOR 'root'@'192.168.1.1' = PASSWORD('靘撖蝣');    // 撠敹閬詨靘 撣唾@IP 湔,銝閬寥臭
1 e$ i( b: r- e/ X1 l8 |& Ymysql> flush privileges;# X/ {2 V, J( z' g$ \2 \% X! n
  t, I* H1 B' d( B
頛詨 SELECT 'User', 'Host', Length('Password') FROM mysql.user; 瑼X亙蝣澆漲,撠勗舐潛曉寧root 撖蝣潮瑕漲撌脫寧41蝣) u0 [" [5 M  G  r6 u$ K
瘜冽:
; L2 a  z: W2 ~3 v% E8 W# q# U憒撣唾憭芸,臭誑啣憿閮剖蝣,粹閮剖蝣 SET PASSWORD FOR 芷撠亙蝣,銝 old_passwords=0 撠撖蝣潮敶梢
===========================================================================7 G& X/ z( ~' U3 w& A
鄉ysql蝝 8.0.21,php逅ysql箇2銵errors:3 Z9 v! L* i8 v
mysqli_real_connect(): Server sent charset (255) unknown to the client. Please, report to the developers$ Q3 `' V& O  @( K' M; l1 \
mysqli_real_connect(): (HY000/2054): Server sent charset unknown to the client. Please, report to the developers
# w; j+ C0 w$ K3 V& H:
. J$ F" A0 Z' `0 \( y" ]
決ySQL 8.0.21銝哨caching_sha2_password舫隤頨思遢撽霅隞塚銝臭誑敺mysql_native_password隞亙php銝詨捆臭誑蝝php嚗銋臭誑靽格遍ySQL蝵柴 曆犖瘙箏靽格遍ySQL蝵:+ c6 S  i& r+ a
vi /etc/my.cnf  乩:
1 H/ D1 l  K) i! L) `[mysqld]* k9 ?+ Y3 R) q  V4 s, O

) f+ ^: ~2 d% v" tcharacter-set-server=utf8
& A7 Y8 x3 ?+ t( U% [$ J9 z% b$ k1 ydefault_authentication_plugin=mysql_native_password
# I8 {- E+ V" J8 s  G, K; H  j2 a' y* Q
[mysql]
1 L: t/ O3 H- ?7 w2 b8 a" `3 ddefault-character-set=utf8
7 q; T7 Y1 E0 V; }$ `! z, F2 a, Z
% X/ k2 I% n2 p( t2 W[client]2 b) I8 F2 I: j. c! A& }* {
default-character-set=utf8
2 q  F6 z" J' E8 m
+ }1 q" Q# e6 V嗅mysqld" r; q) @& ]% @2 M: p5 }
service mysqld restart
* K' Q9 z/ p0 U( P! Y摰!!0 y* j8 o8 }0 w, L
9 P1 ~# O! q1 K6 [6 a

# K0 `6 d! f8 H9 I' l1 H( C: M: l

雿輻券

祉蝛閬

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

QQ|撠暺撅||52AV璈A

GMT+8, 2026-3-26 16:17 , Processed in 0.087155 second(s), 16 queries .

蝯∠.撱

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

鋆貉憒 敹恍敺 餈銵