52AV璈A|52AV.ONE

 曉撖蝣
 蝡唾酉
敹急瑕
  • av隢憯BBS
  • 璈A
  • 芣瑟憭瘚
  • 鞎澆
  • 52av鋆貉摰
  • 銝剜-銝剖銝餅
     
亦: 5078|敺: 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').5 J: X5 c, M" b3 F8 p, t3 K

# [  e8 }* [) X' x9 G. B* @" l臬歉hp 5.3隞亙撖蝣潭16雿蝺函Ⅳ,啁php 5.3隞亙41雿蝺函Ⅳ,mysql 5.2 隞亙閮凋16蝣,隞交甇斤車航炊." ~/ o+ A. D+ r3 z
閮箸瑚銝mysql: (php 5.6.38 , mysql 5.1.73)) _- O# t1 c( P; U# J( E
餃叮ysql 嗅頛詨 : 5 \, y$ J1 a9 j6 L- f
mysql> SHOW VARIABLES LIKE 'old_passwords';) L9 z" n. w( o+ D# q3 Y+ V1 a
+------------------+-------+. P) L0 y5 O) G: O; m
| Variable_name | Value |
( V1 T# T, B5 b: Q: K+------------------+-------+
. C+ [$ `1 k$ T' A2 m* L% C* y| old_passwords | ON   |7 Y8 e/ p) ^4 e. \+ b9 ]; k; C
+------------------+-------+! m. O. h! g7 S
1 row in set (0.00 sec)
2 N( n+ _7 ?5 e  j# z  e* L
4 ]* V9 d4 y+ O- M/ ], s1 {old_password  ==> ON  撠梯”蝷 /etc/my.cnf  鋆 old_passwords=1  閮剖16蝣,撠摰閮剔 0 嗅mysqld ==> service mysqld restart
3 B' }: J  }: g3 R* N2 W/ V# j- u mysql prompt銝頛詨:0 y; S4 K5 q, {9 S8 [5 ^4 Z7 l3 U
mysql> SET old_passwords=FALSE;  
7 g2 c  y: w' v瑼X叮ysql.user 瘥撖蝣潮瑕漲:- G+ K% k. P5 ^3 m5 V7 K- _9 @
mysql> SELECT 'User', 'Host', Length('Password') FROM mysql.user;, Q7 F6 ]1 N+ ?' c8 o( [7 D6 e
憒瘝寞41雿,Length('Password')甈雿閰脤賣160(銵函內瘝閮剖蝣)
9 c1 g& ~! E5 w
# b2 Y, W$ M/ ]% f; i閮剖靘撖蝣:
! F* d# c$ p; D$ [9 ^+ P5 S; Mmysql> SET PASSWORD FOR 'root'@'192.168.1.1' = PASSWORD('靘撖蝣');    // 撠敹閬詨靘 撣唾@IP 湔,銝閬寥臭2 ~" j# g# ?! S( Q7 {
mysql> flush privileges;7 ^. h  Y3 n5 `' O4 A# o% N

! H/ O7 g$ p# v2 e7 G頛詨 SELECT 'User', 'Host', Length('Password') FROM mysql.user; 瑼X亙蝣澆漲,撠勗舐潛曉寧root 撖蝣潮瑕漲撌脫寧41蝣* _/ Y0 T9 i$ u5 L1 `; d6 z
瘜冽:1 _; q  T. Z; `8 M" t3 N' C
憒撣唾憭芸,臭誑啣憿閮剖蝣,粹閮剖蝣 SET PASSWORD FOR 芷撠亙蝣,銝 old_passwords=0 撠撖蝣潮敶梢
===========================================================================
' p. ^2 n; H/ E' Z$ m3 m鄉ysql蝝 8.0.21,php逅ysql箇2銵errors:0 t) X' M' x& U4 T! h$ p4 U
mysqli_real_connect(): Server sent charset (255) unknown to the client. Please, report to the developers
* Y* P( A, I( b$ W$ R9 Kmysqli_real_connect(): (HY000/2054): Server sent charset unknown to the client. Please, report to the developers4 i( E* f- ]: n* N$ K
:
& ]0 K: n! B8 a# n9 U3 O( ^
決ySQL 8.0.21銝哨caching_sha2_password舫隤頨思遢撽霅隞塚銝臭誑敺mysql_native_password隞亙php銝詨捆臭誑蝝php嚗銋臭誑靽格遍ySQL蝵柴 曆犖瘙箏靽格遍ySQL蝵:" ^- \; y' y6 h4 T& k
vi /etc/my.cnf  乩:. X2 `: \6 b7 b7 z
[mysqld]4 y! j: b3 G( S6 q' s

6 w: Z+ }# Z/ a6 k$ ~3 T* S* Ncharacter-set-server=utf8
8 z/ |  x, P4 K. ydefault_authentication_plugin=mysql_native_password6 i! s) y( \  [9 o( v. j
7 @. c7 a9 r, w* s
[mysql]# l+ C/ n- P( x$ s
default-character-set=utf82 d& I. l$ e* V( Q0 ?6 a
8 B: ~9 t$ }. E9 n) n5 V
[client]2 m$ \" Q! O2 E5 a8 ~  l& y+ Y
default-character-set=utf8) N8 |0 `0 t1 ~( n5 o3 K; l
* C# h- \" m, N9 z. V6 a; X8 P
嗅mysqld
' N' a! _) p- K; t/ X" }6 Aservice mysqld restart' q/ ~. i9 [2 V
摰!!
$ J+ Y0 ]/ C4 R( J
" U- E2 R) @- ]- r

, s0 Q4 q1 V2 T

雿輻券

祉蝛閬

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

QQ|撠暺撅||52AV璈A

GMT+8, 2026-3-1 22:41 , Processed in 0.074212 second(s), 16 queries .

蝯∠.撱

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

鋆貉憒 敹恍敺 餈銵