52AV璈A|52AV.ONE

 曉撖蝣
 蝡唾酉
敹急瑕
  • av隢憯BBS
  • 璈A
  • 芣瑟憭瘚
  • 鞎澆
  • 52av鋆貉摰
  • 銝剜-銝剖銝餅
     
亦: 5005|敺: 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').
6 ]+ k, |, z$ b3 |, Q
8 u& W% E' f* d: S  N, g+ f1 {臬歉hp 5.3隞亙撖蝣潭16雿蝺函Ⅳ,啁php 5.3隞亙41雿蝺函Ⅳ,mysql 5.2 隞亙閮凋16蝣,隞交甇斤車航炊.
1 H! H/ v7 T! d6 t$ h- y; c# A閮箸瑚銝mysql: (php 5.6.38 , mysql 5.1.73)
' n6 W  n. j0 x0 H2 _餃叮ysql 嗅頛詨 :
$ g& R6 E9 i2 pmysql> SHOW VARIABLES LIKE 'old_passwords';
+ ~) q: ^5 E3 j% j+------------------+-------+/ x; u( W2 w% V( l$ y
| Variable_name | Value |
. i5 I5 A8 [3 w( j* [+------------------+-------+
# |! ~  `3 b6 g7 I, T| old_passwords | ON   |5 B3 k! x4 {( t, q, H8 b4 p
+------------------+-------+' R# K& O% h  J; ^9 ~
1 row in set (0.00 sec)
9 W8 F$ x8 V9 Q% X0 l
. D2 d6 N3 y- n  C/ U* [3 fold_password  ==> ON  撠梯”蝷 /etc/my.cnf  鋆 old_passwords=1  閮剖16蝣,撠摰閮剔 0 嗅mysqld ==> service mysqld restart
/ G, C+ b) C- b; y( [ mysql prompt銝頛詨:# ]" h% T  e& N  n5 E
mysql> SET old_passwords=FALSE;  2 A, t2 y5 @! B& ?0 F6 j
瑼X叮ysql.user 瘥撖蝣潮瑕漲:
* m9 Z# P8 I, Omysql> SELECT 'User', 'Host', Length('Password') FROM mysql.user;
* O4 Q' L) H. ^: p5 _憒瘝寞41雿,Length('Password')甈雿閰脤賣160(銵函內瘝閮剖蝣)
: ^$ Z! Q& k- p4 j. O; l* t( ]" w+ s4 [* X$ W7 L
閮剖靘撖蝣:" v' s. Q) H( H$ [; ?# z. ?2 Q
mysql> SET PASSWORD FOR 'root'@'192.168.1.1' = PASSWORD('靘撖蝣');    // 撠敹閬詨靘 撣唾@IP 湔,銝閬寥臭- F+ e: d+ g: C& J: I* |
mysql> flush privileges;* @+ `, o! R; E3 [' Y- D

% P9 q* |3 n2 j頛詨 SELECT 'User', 'Host', Length('Password') FROM mysql.user; 瑼X亙蝣澆漲,撠勗舐潛曉寧root 撖蝣潮瑕漲撌脫寧41蝣
& y! R: k. Q8 C' R( d1 b3 v7 _瘜冽:
7 n9 d* O  C8 P9 P! n* E憒撣唾憭芸,臭誑啣憿閮剖蝣,粹閮剖蝣 SET PASSWORD FOR 芷撠亙蝣,銝 old_passwords=0 撠撖蝣潮敶梢
===========================================================================/ n" y7 W4 y* F; \: m# K
鄉ysql蝝 8.0.21,php逅ysql箇2銵errors:; D: f7 M2 b8 F1 M
mysqli_real_connect(): Server sent charset (255) unknown to the client. Please, report to the developers4 s# ~, i- r# ~  m- {
mysqli_real_connect(): (HY000/2054): Server sent charset unknown to the client. Please, report to the developers
) r) y) N! h1 f3 V4 D:

/ L& N' T8 @( e決ySQL 8.0.21銝哨caching_sha2_password舫隤頨思遢撽霅隞塚銝臭誑敺mysql_native_password隞亙php銝詨捆臭誑蝝php嚗銋臭誑靽格遍ySQL蝵柴 曆犖瘙箏靽格遍ySQL蝵:/ [, z+ k+ j5 X  |# r" F- I
vi /etc/my.cnf  乩:9 W* W- i' `' d! i4 [0 \
[mysqld]
: |0 D$ V- P. ?% x2 U. ]; K$ X; M1 q! q
character-set-server=utf84 I: r" L/ `. s& p
default_authentication_plugin=mysql_native_password, ]3 f8 T1 x2 y5 k# F, h& Y+ Z

! z9 ^; W0 u: G[mysql]
/ @# D9 X& L# p& q; |7 j9 {default-character-set=utf8" K7 @) h4 f! ], q8 n- c+ w4 U
3 u1 n5 N1 z( g, X
[client]
% e) f+ y7 m  ]$ _- w0 gdefault-character-set=utf87 _7 K0 y) q/ g3 v4 o/ [

* g- q1 S9 z  a9 @: P  D( H嗅mysqld7 P' m& P* a6 V) {+ @$ z5 n
service mysqld restart
; g: j! N& b# E( S$ G( J摰!!% z. q. Y( s3 }1 S9 e9 T7 ]- `! A9 p
# }. o/ ^4 K3 g
( Z4 r$ `: z" m8 r  t

雿輻券

祉蝛閬

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

QQ|撠暺撅||52AV璈A

GMT+8, 2026-2-8 08:13 , Processed in 0.071546 second(s), 16 queries .

蝯∠.撱

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

鋆貉憒 敹恍敺 餈銵