52AV璈A|52AV.ONE

 曉撖蝣
 蝡唾酉
敹急瑕
  • av隢憯BBS
  • 璈A
  • 芣瑟憭瘚
  • 鞎澆
  • 52av鋆貉摰
  • 銝剜-銝剖銝餅
Yahoo!憟拇撠
望: 璈A
Google憟拇撠
望: 璈A
     
亦: 2995|敺: 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').$ M! g6 R! J8 M5 m- |2 f
2 P& P$ ]  X5 k% x2 K  }/ l
臬歉hp 5.3隞亙撖蝣潭16雿蝺函Ⅳ,啁php 5.3隞亙41雿蝺函Ⅳ,mysql 5.2 隞亙閮凋16蝣,隞交甇斤車航炊.
$ p* o- v) S6 H) N9 T閮箸瑚銝mysql: (php 5.6.38 , mysql 5.1.73)
. f$ x) J! F# v; @9 T! }餃叮ysql 嗅頛詨 : " D/ l' k3 p1 ]: t+ ~% _5 f8 i' l6 M2 p
mysql> SHOW VARIABLES LIKE 'old_passwords';' |! y4 _* E+ ^8 z" z/ X. ^
+------------------+-------+$ y: S+ n0 U: b5 ?% r
| Variable_name | Value |
/ b% S* E+ G% t; H+------------------+-------+
8 X9 [) O* M" X; w4 V| old_passwords | ON   |4 ^5 o2 [& [$ g2 q  q
+------------------+-------+! p: m: k( j2 |% K
1 row in set (0.00 sec)
% m' x2 Q6 A) L
6 I6 s1 L5 A+ U1 x+ L( Vold_password  ==> ON  撠梯”蝷 /etc/my.cnf  鋆 old_passwords=1  閮剖16蝣,撠摰閮剔 0 嗅mysqld ==> service mysqld restart2 t, y2 k; P! q% o  }6 N
mysql prompt銝頛詨:  E' T/ _) G* u% Z
mysql> SET old_passwords=FALSE;  
; T& C8 h# j& g- a* a$ b瑼X叮ysql.user 瘥撖蝣潮瑕漲:7 p) u- U! m3 X' ]1 T7 {$ u; k
mysql> SELECT 'User', 'Host', Length('Password') FROM mysql.user;
, P2 M- D4 B. ~- ^) Y* K! b1 y憒瘝寞41雿,Length('Password')甈雿閰脤賣160(銵函內瘝閮剖蝣) + a4 Q( a* ]! q5 I2 G
, q/ E) i, Q, s0 }# G/ N
閮剖靘撖蝣:
) g: @! Z* \& Q' I1 Y& l' p% j: `1 omysql> SET PASSWORD FOR 'root'@'192.168.1.1' = PASSWORD('靘撖蝣');    // 撠敹閬詨靘 撣唾@IP 湔,銝閬寥臭1 E3 B  ]% U. q4 s' y
mysql> flush privileges;4 z5 H1 V3 F& ^' C' w

- b  W. z3 o" G! O* F9 H頛詨 SELECT 'User', 'Host', Length('Password') FROM mysql.user; 瑼X亙蝣澆漲,撠勗舐潛曉寧root 撖蝣潮瑕漲撌脫寧41蝣
1 p1 s/ T9 v* V# y+ L; _6 ^! o瘜冽:
& w% K7 K% R7 K% f" X9 f6 |6 [憒撣唾憭芸,臭誑啣憿閮剖蝣,粹閮剖蝣 SET PASSWORD FOR 芷撠亙蝣,銝 old_passwords=0 撠撖蝣潮敶梢
===========================================================================4 y: {' H( h) [" J6 P4 L4 S
鄉ysql蝝 8.0.21,php逅ysql箇2銵errors:
, a. L% n: L# U  o2 E' C6 ^mysqli_real_connect(): Server sent charset (255) unknown to the client. Please, report to the developers# t/ t1 w/ A% h* }
mysqli_real_connect(): (HY000/2054): Server sent charset unknown to the client. Please, report to the developers
& a/ J) s( S. J9 H3 T  n; \:

3 b0 o& \, W( j& {7 `" Y  J決ySQL 8.0.21銝哨caching_sha2_password舫隤頨思遢撽霅隞塚銝臭誑敺mysql_native_password隞亙php銝詨捆臭誑蝝php嚗銋臭誑靽格遍ySQL蝵柴 曆犖瘙箏靽格遍ySQL蝵:
4 F' M( p$ v5 z) i# Rvi /etc/my.cnf  乩:
6 }: F* J0 ^3 v& f) o$ H, w+ R5 c[mysqld]
* Q% l2 \5 F9 I) Z( B' G! E& K- N
character-set-server=utf8
) F; A4 o9 s, Q; l4 v3 Kdefault_authentication_plugin=mysql_native_password2 _3 d( ?' ^# s+ {$ K$ @

% x/ ^' w/ [+ x+ t' C( @. }7 [[mysql]
7 G: E! x2 r6 J- t# @! wdefault-character-set=utf8
$ p( T& ~* X( ^  E1 H! x: W5 L& W+ ]. L) \1 ?
[client]: O7 t1 r' e0 A/ q4 z
default-character-set=utf8: f7 O8 }5 z* X% h6 [& D- m: ~

6 e. W# W: a) j嗅mysqld
% f, \( T7 w, d6 X7 }service mysqld restart( F. u5 R1 X5 l' p
摰!!4 Q# k2 @: @8 L) C
0 r. `* |5 r- R$ m* N# _

) Y2 P* P) ^$ s! r3 v

雿輻券

祉蝛閬

BT蝳

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

QQ|撠暺撅||52AV璈A

GMT+8, 2024-6-2 10:51 , Processed in 0.069306 second(s), 16 queries .

蝯∠.撱

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

鋆貉憒 敹恍敺 餈銵