52AV璈A|52AV.ONE

 曉撖蝣
 蝡唾酉
敹急瑕
  • av隢憯BBS
  • 璈A
  • 芣瑟憭瘚
  • 鞎澆
  • 52av鋆貉摰
  • 銝剜-銝剖銝餅
     
亦: 5119|敺: 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').# x8 J( ~  n1 D9 E1 X( J# d
5 v* P6 U$ \; |1 W* C* S2 t
臬歉hp 5.3隞亙撖蝣潭16雿蝺函Ⅳ,啁php 5.3隞亙41雿蝺函Ⅳ,mysql 5.2 隞亙閮凋16蝣,隞交甇斤車航炊.% `4 j7 S  w1 _5 m& H) e
閮箸瑚銝mysql: (php 5.6.38 , mysql 5.1.73)
8 u6 D8 n4 m1 l- S! A, b7 R) p* l9 W9 C餃叮ysql 嗅頛詨 :
# ]9 E! d6 z  a6 A7 b) tmysql> SHOW VARIABLES LIKE 'old_passwords';" j- [" ]8 |0 {5 ]: Y: L
+------------------+-------+
9 t  E( W7 {4 k+ U| Variable_name | Value |
1 f/ Y# R- b6 y& ~" {' `+------------------+-------+
' j, e; l; g* u| old_passwords | ON   |/ S% p- L+ W7 [- S8 G! x6 m
+------------------+-------+
& R  X5 T0 z; b$ q) w$ {( |1 row in set (0.00 sec)
3 n  S" c1 J2 A7 d5 c4 S+ L  b6 f, j  l1 G2 F$ A* Q/ u
old_password  ==> ON  撠梯”蝷 /etc/my.cnf  鋆 old_passwords=1  閮剖16蝣,撠摰閮剔 0 嗅mysqld ==> service mysqld restart! P. d; _: @) j( D- C3 y
mysql prompt銝頛詨:
3 }6 ~% P' _6 V, k; c( |mysql> SET old_passwords=FALSE;  / k- y. L! u1 m$ r/ {  C8 ?! f1 n
瑼X叮ysql.user 瘥撖蝣潮瑕漲:+ b4 X% e. D2 H) B% ?2 m4 o
mysql> SELECT 'User', 'Host', Length('Password') FROM mysql.user;( G( u2 M9 O9 e9 N* V" z& @
憒瘝寞41雿,Length('Password')甈雿閰脤賣160(銵函內瘝閮剖蝣)
1 Z  i+ z7 s- S! E0 z0 w' D) Z4 F  }; S+ p
閮剖靘撖蝣:9 r$ s0 J  n# z' G
mysql> SET PASSWORD FOR 'root'@'192.168.1.1' = PASSWORD('靘撖蝣');    // 撠敹閬詨靘 撣唾@IP 湔,銝閬寥臭
0 G! e! M- N& _) \. j0 U2 ~' y/ Ymysql> flush privileges;
; N+ |; g  X7 D1 p  _5 q
0 H. |" n! W5 r) W% q4 K9 T頛詨 SELECT 'User', 'Host', Length('Password') FROM mysql.user; 瑼X亙蝣澆漲,撠勗舐潛曉寧root 撖蝣潮瑕漲撌脫寧41蝣
/ ~0 {0 @* V( N; O瘜冽:: e3 `: W# e+ {, ]* [. g2 Y
憒撣唾憭芸,臭誑啣憿閮剖蝣,粹閮剖蝣 SET PASSWORD FOR 芷撠亙蝣,銝 old_passwords=0 撠撖蝣潮敶梢
===========================================================================
, Q/ J7 j* l9 e. n9 _鄉ysql蝝 8.0.21,php逅ysql箇2銵errors:8 b5 B6 g0 j0 V6 ^% a1 S6 [, n
mysqli_real_connect(): Server sent charset (255) unknown to the client. Please, report to the developers
, C# I9 n& X  O6 _mysqli_real_connect(): (HY000/2054): Server sent charset unknown to the client. Please, report to the developers, ?1 g" x0 q1 J
:

/ U+ @- c  \2 T* o' A  n決ySQL 8.0.21銝哨caching_sha2_password舫隤頨思遢撽霅隞塚銝臭誑敺mysql_native_password隞亙php銝詨捆臭誑蝝php嚗銋臭誑靽格遍ySQL蝵柴 曆犖瘙箏靽格遍ySQL蝵:
/ Z) T: i# K' H; k/ a  U/ Evi /etc/my.cnf  乩:6 Y  @, F) I  J/ t. r: F
[mysqld]
% r& y1 ~9 G/ M. r( _$ s
& U. p0 |( _3 B; @# z( |- tcharacter-set-server=utf8
5 @' }9 w% H* a, K: l7 x0 Y$ W" xdefault_authentication_plugin=mysql_native_password
0 Y1 J2 f$ t' I7 W3 P4 @" n- f9 l( [' c* {) [/ s, g
[mysql]
+ U1 ^- ^$ |8 C2 Qdefault-character-set=utf8$ ]) y& O* `* U2 h
( G% F0 T2 I/ l0 {
[client]
4 x, Q9 b  C* S1 Tdefault-character-set=utf8
- |" ^$ K6 ?5 Z6 a! N& D! [4 I0 M' G# ~- {
嗅mysqld8 k2 x6 d) D- [* k
service mysqld restart
7 `- @2 K4 F- \- h摰!!
1 A& F( }) g9 e. z% m, C& j

* s) Z. p% y6 W% h8 u' U% ^
- C% i8 f8 T3 `( Z9 Q

雿輻券

祉蝛閬

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

QQ|撠暺撅||52AV璈A

GMT+8, 2026-3-19 00:46 , Processed in 0.089296 second(s), 16 queries .

蝯∠.撱

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

鋆貉憒 敹恍敺 餈銵