52AV璈A|52AV.ONE

 曉撖蝣
 蝡唾酉
敹急瑕
  • av隢憯BBS
  • 璈A
  • 芣瑟憭瘚
  • 鞎澆
  • 52av鋆貉摰
  • 銝剜-銝剖銝餅
     
亦: 5118|敺: 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').3 \" a3 ]& w. k8 p# i

6 K. u- d# K" J6 @& V( [臬歉hp 5.3隞亙撖蝣潭16雿蝺函Ⅳ,啁php 5.3隞亙41雿蝺函Ⅳ,mysql 5.2 隞亙閮凋16蝣,隞交甇斤車航炊.
8 v) O$ L! h! g  [閮箸瑚銝mysql: (php 5.6.38 , mysql 5.1.73)4 f. x. n) A. B  T0 l
餃叮ysql 嗅頛詨 :
% Y! \' W7 ~- k/ Omysql> SHOW VARIABLES LIKE 'old_passwords';
4 V5 \( y! Y  t/ u+------------------+-------+
: x5 n( ^; x( M+ s" }| Variable_name | Value |4 n* {# t: Q# J7 L9 t
+------------------+-------+
3 w; X( a* i+ |  @) ?  G% R| old_passwords | ON   |
: i9 D9 S: q. M+------------------+-------+
4 O) k' f, \, ]) t& o1 row in set (0.00 sec)
6 m& J) |# f9 J7 n7 ]$ X; x; S* E* d5 S6 ]/ e: `) i" K
old_password  ==> ON  撠梯”蝷 /etc/my.cnf  鋆 old_passwords=1  閮剖16蝣,撠摰閮剔 0 嗅mysqld ==> service mysqld restart. f7 s4 Y1 e3 F) Y5 k0 o
mysql prompt銝頛詨:
! j; ?- {3 A* J! L: o' r6 tmysql> SET old_passwords=FALSE;  & h- \# Z" u- k
瑼X叮ysql.user 瘥撖蝣潮瑕漲:$ t  X# _5 o1 a
mysql> SELECT 'User', 'Host', Length('Password') FROM mysql.user;
7 [. T3 b+ k# u3 k6 ~/ A憒瘝寞41雿,Length('Password')甈雿閰脤賣160(銵函內瘝閮剖蝣)   T/ L. g1 H0 B& p! s
+ }4 Y* D0 q% M
閮剖靘撖蝣:) a) q& ^* \! ^# Z
mysql> SET PASSWORD FOR 'root'@'192.168.1.1' = PASSWORD('靘撖蝣');    // 撠敹閬詨靘 撣唾@IP 湔,銝閬寥臭
: G8 g3 _. ]+ z6 ^) D, k$ f/ i3 Amysql> flush privileges;$ q. O; D, d- q% I" L* s) |0 I- ~

- A2 Y$ n% P$ h, C. H% P- i9 l頛詨 SELECT 'User', 'Host', Length('Password') FROM mysql.user; 瑼X亙蝣澆漲,撠勗舐潛曉寧root 撖蝣潮瑕漲撌脫寧41蝣
* W' o& M* |( _% l. A1 U瘜冽:# a: {5 w1 W2 w1 K
憒撣唾憭芸,臭誑啣憿閮剖蝣,粹閮剖蝣 SET PASSWORD FOR 芷撠亙蝣,銝 old_passwords=0 撠撖蝣潮敶梢
===========================================================================; P( B5 A( ~5 @" z
鄉ysql蝝 8.0.21,php逅ysql箇2銵errors:- ^) J& u6 M. y- o+ P5 D
mysqli_real_connect(): Server sent charset (255) unknown to the client. Please, report to the developers. l/ F7 }0 R" l, g9 s: Z$ o
mysqli_real_connect(): (HY000/2054): Server sent charset unknown to the client. Please, report to the developers
  T& D0 C% f* q6 q" o6 V:

/ T% w; L( Y4 t  u8 l決ySQL 8.0.21銝哨caching_sha2_password舫隤頨思遢撽霅隞塚銝臭誑敺mysql_native_password隞亙php銝詨捆臭誑蝝php嚗銋臭誑靽格遍ySQL蝵柴 曆犖瘙箏靽格遍ySQL蝵:
( t2 X, D4 r) v2 tvi /etc/my.cnf  乩:
( |+ b& s8 m" y9 l: D$ Q3 N[mysqld]) O! z0 a7 [! A+ l& G. F. y
8 J9 Z0 j) [. i/ R. I( v
character-set-server=utf85 {  h3 B* X0 \2 D. @
default_authentication_plugin=mysql_native_password( B6 M0 P& _0 ^1 l  V* D# J# K: u
, @/ R" A+ G9 @. Y
[mysql]
6 u/ v2 J! L2 f1 P5 }. Q0 Rdefault-character-set=utf82 u  ~# _1 L' M$ m+ Z7 E1 v
) l# y6 X1 `; Z* \' K( j* l: M# P
[client]
( Q! Q+ `0 t2 Ddefault-character-set=utf8( }! ^+ P7 W( ^+ Z; D

) C; q! ~5 d9 G嗅mysqld
9 u$ e) ~( y( B* o6 G, Mservice mysqld restart
7 h' C; a' [( [2 H/ w7 T) A: c1 ~摰!!) S/ O. c2 N5 K- j* Z- `
1 J; G+ B+ r9 h4 _1 n3 {

- B# ?) c3 B" d5 u- t: z7 t

雿輻券

祉蝛閬

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

QQ|撠暺撅||52AV璈A

GMT+8, 2026-3-18 06:31 , Processed in 0.069230 second(s), 16 queries .

蝯∠.撱

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

鋆貉憒 敹恍敺 餈銵