52AV璈A|52AV.ONE

 曉撖蝣
 蝡唾酉
敹急瑕
  • av隢憯BBS
  • 璈A
  • 芣瑟憭瘚
  • 鞎澆
  • 52av鋆貉摰
  • 銝剜-銝剖銝餅
     
亦: 3123|敺: 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').; ]7 _7 s5 T5 F& _1 `# Q6 N

! ?0 [7 K+ R6 J) b6 @臬歉hp 5.3隞亙撖蝣潭16雿蝺函Ⅳ,啁php 5.3隞亙41雿蝺函Ⅳ,mysql 5.2 隞亙閮凋16蝣,隞交甇斤車航炊.& w7 Y. d( d( ^. \$ t: ^/ C
閮箸瑚銝mysql: (php 5.6.38 , mysql 5.1.73)
6 P5 U+ X- _, _, A7 w餃叮ysql 嗅頛詨 : % @- |! F6 ^* n; u4 e  k, G
mysql> SHOW VARIABLES LIKE 'old_passwords';
4 v% \$ x  J5 Q  [7 M+ B5 a9 t. z+------------------+-------+
9 h1 m# ?  y/ \6 F# A2 n+ D# f| Variable_name | Value |
# p9 N( P$ Q$ J" E$ q+------------------+-------+
3 {+ w7 r) \6 I5 f| old_passwords | ON   |# N1 F8 P* n( h$ l9 c5 j+ W# H
+------------------+-------+
$ U- s; ?  P; s1 row in set (0.00 sec), y) L! ], w* o& J0 R/ O0 j
( L% m, I, ^1 A. {3 X2 ?% G
old_password  ==> ON  撠梯”蝷 /etc/my.cnf  鋆 old_passwords=1  閮剖16蝣,撠摰閮剔 0 嗅mysqld ==> service mysqld restart
6 w4 \, i/ _# _ mysql prompt銝頛詨:
8 |) R; H. @& T$ Z! O( z* f0 q3 Emysql> SET old_passwords=FALSE;  
8 V) S  H$ ^' r5 O瑼X叮ysql.user 瘥撖蝣潮瑕漲:8 u. O2 Z: P1 ~( `
mysql> SELECT 'User', 'Host', Length('Password') FROM mysql.user;' ~, k5 Z% j& I' ]
憒瘝寞41雿,Length('Password')甈雿閰脤賣160(銵函內瘝閮剖蝣) / j! i8 d( Z) E3 Z
; R+ U$ A2 y8 }1 P
閮剖靘撖蝣:
: R% Z5 D3 a. q( e) T1 u1 `' Qmysql> SET PASSWORD FOR 'root'@'192.168.1.1' = PASSWORD('靘撖蝣');    // 撠敹閬詨靘 撣唾@IP 湔,銝閬寥臭  r) S9 V6 {9 I* ]" C& b
mysql> flush privileges;
, s# ?% p0 L; |8 x# B" m& f9 W. `# |" v
頛詨 SELECT 'User', 'Host', Length('Password') FROM mysql.user; 瑼X亙蝣澆漲,撠勗舐潛曉寧root 撖蝣潮瑕漲撌脫寧41蝣
9 n+ U7 P1 O0 l! j: y5 T瘜冽:- }# p1 f9 X) R4 o
憒撣唾憭芸,臭誑啣憿閮剖蝣,粹閮剖蝣 SET PASSWORD FOR 芷撠亙蝣,銝 old_passwords=0 撠撖蝣潮敶梢
===========================================================================
# c+ W: I+ s9 V+ Q  P鄉ysql蝝 8.0.21,php逅ysql箇2銵errors:
% _* u+ N# f' k! z1 Z& ]1 B; vmysqli_real_connect(): Server sent charset (255) unknown to the client. Please, report to the developers2 n( z1 u" F- \: x% A( b
mysqli_real_connect(): (HY000/2054): Server sent charset unknown to the client. Please, report to the developers+ V1 D& S; |1 e" C& L
:

% H9 S6 _) k0 L& \+ e6 ^( v決ySQL 8.0.21銝哨caching_sha2_password舫隤頨思遢撽霅隞塚銝臭誑敺mysql_native_password隞亙php銝詨捆臭誑蝝php嚗銋臭誑靽格遍ySQL蝵柴 曆犖瘙箏靽格遍ySQL蝵:' q1 }' p1 I, S; I
vi /etc/my.cnf  乩:
" r! P) p% H' V6 X+ ][mysqld]4 u3 B0 ^( _: r) H4 J

3 q" N: E& }0 q9 ~character-set-server=utf8
& `+ B' P, S2 v2 F' zdefault_authentication_plugin=mysql_native_password& B  B. H0 y, X2 ~# W
4 D1 n5 a; Q% t) c' W& d
[mysql]
9 {5 S) W; J$ Idefault-character-set=utf8' c) d  _5 e4 ^# G
( ?: l, q( @+ m
[client]9 P2 m+ m' O/ O6 `
default-character-set=utf8
, u8 P7 ]2 @6 }
4 l  x) K% ]  t5 T  \嗅mysqld
6 k+ S: t% Y3 b% e6 Q2 ^1 l. ^. A9 Pservice mysqld restart+ l% f6 K, g! z' o3 Y
摰!!: E& E% V0 O" X- J5 Y: E  j4 u6 x
7 U7 C1 ?5 S  q  ^% l

: I0 r0 i9 Q) \

雿輻券

祉蝛閬

BT蝳

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

QQ|撠暺撅||52AV璈A

GMT+8, 2024-8-15 20:01 , Processed in 0.053062 second(s), 16 queries .

蝯∠.撱

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

鋆貉憒 敹恍敺 餈銵