52AV璈A|52AV.ONE

 曉撖蝣
 蝡唾酉
敹急瑕
  • av隢憯BBS
  • 璈A
  • 芣瑟憭瘚
  • 鞎澆
  • 52av鋆貉摰
  • 銝剜-銝剖銝餅
     
亦: 2928|敺: 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').$ V; \2 W9 j  O# R- O8 c
- }2 R8 n/ e1 n+ y2 H: b; Z
臬歉hp 5.3隞亙撖蝣潭16雿蝺函Ⅳ,啁php 5.3隞亙41雿蝺函Ⅳ,mysql 5.2 隞亙閮凋16蝣,隞交甇斤車航炊.
# c* k' W5 W1 ]% o3 C2 J閮箸瑚銝mysql: (php 5.6.38 , mysql 5.1.73)5 y6 d* Z; Q) V
餃叮ysql 嗅頛詨 :
  _$ ?6 ~) R/ v+ u' w( K- K% ]mysql> SHOW VARIABLES LIKE 'old_passwords';
$ ^8 j7 j5 P, O1 P; ?+------------------+-------+4 s$ k) t# `- I* ]+ g
| Variable_name | Value |
6 A# G2 b5 W+ x7 ?2 h( d% ]$ B+------------------+-------+
! l+ r5 A5 f' b! a| old_passwords | ON   |
. h- j! k) M% H2 R+------------------+-------+
' K/ M* p% {! A/ v/ F1 row in set (0.00 sec)
% o, J% P& ~' Z' k, M/ a: D( w: T4 e& M
old_password  ==> ON  撠梯”蝷 /etc/my.cnf  鋆 old_passwords=1  閮剖16蝣,撠摰閮剔 0 嗅mysqld ==> service mysqld restart
9 w1 M' K5 f& }$ N' b mysql prompt銝頛詨:
: d4 D( o+ p% P! F# e3 O1 ~mysql> SET old_passwords=FALSE;  : r! d: U+ A, i( o* l: I' P4 T
瑼X叮ysql.user 瘥撖蝣潮瑕漲:
, }% x3 n5 t8 \( Smysql> SELECT 'User', 'Host', Length('Password') FROM mysql.user;6 V- g1 ~$ Y7 L: J/ f
憒瘝寞41雿,Length('Password')甈雿閰脤賣160(銵函內瘝閮剖蝣) & l+ `' b$ m/ e
3 r* ]8 Z, E( B' N+ E' q& V3 D, |" q1 O
閮剖靘撖蝣:  j: x5 D. h2 h: G
mysql> SET PASSWORD FOR 'root'@'192.168.1.1' = PASSWORD('靘撖蝣');    // 撠敹閬詨靘 撣唾@IP 湔,銝閬寥臭
5 U8 E% m7 T: e; a# I' Smysql> flush privileges;
8 X4 {' o; p8 G0 v# {) G% P5 R% X2 L# W* t$ c1 Q
頛詨 SELECT 'User', 'Host', Length('Password') FROM mysql.user; 瑼X亙蝣澆漲,撠勗舐潛曉寧root 撖蝣潮瑕漲撌脫寧41蝣
# ^$ y( X) @3 V7 V瘜冽:- Q5 ]+ r4 _# x9 Y
憒撣唾憭芸,臭誑啣憿閮剖蝣,粹閮剖蝣 SET PASSWORD FOR 芷撠亙蝣,銝 old_passwords=0 撠撖蝣潮敶梢
===========================================================================; x, [5 Q5 O# W# x! U  {( C
鄉ysql蝝 8.0.21,php逅ysql箇2銵errors:6 B2 q' s4 E& ]+ E* J
mysqli_real_connect(): Server sent charset (255) unknown to the client. Please, report to the developers
' I) P1 Z# L( umysqli_real_connect(): (HY000/2054): Server sent charset unknown to the client. Please, report to the developers
' D* d- Q! n- s- b8 i:

5 I0 n3 B: T' c& J, a7 |; K決ySQL 8.0.21銝哨caching_sha2_password舫隤頨思遢撽霅隞塚銝臭誑敺mysql_native_password隞亙php銝詨捆臭誑蝝php嚗銋臭誑靽格遍ySQL蝵柴 曆犖瘙箏靽格遍ySQL蝵:
. n5 ~2 H4 }* gvi /etc/my.cnf  乩:
" o6 e3 Y7 V* e) i) u$ a[mysqld]
& o+ h/ ~; W; `* x4 S* j" N/ _! b6 M2 F% @
character-set-server=utf8, r" b1 C% N0 F1 l% [, d
default_authentication_plugin=mysql_native_password# w5 a/ ?- W: {
* {4 i7 u& U9 Q! L
[mysql]
5 c& ]2 _6 c5 }6 hdefault-character-set=utf8& F/ `$ s- {- Q# a; j! h" Z& N
. ^& K5 Z1 g' R5 p: H3 I( L
[client]. Y# H' h) Z$ d3 N4 N; \  K& F
default-character-set=utf8
( S5 z, y5 b  O8 M7 P- d9 Q: f/ d# U/ L' d9 r, J0 R) ^9 R
嗅mysqld# n& {( Q2 p/ e# j
service mysqld restart
: y  |8 K7 H; G4 q摰!!
1 G7 G& q% ~+ J# X+ P

8 O) c" h% A9 f8 g# w/ {3 P7 [! f  w# i% d6 R6 @

雿輻券

祉蝛閬

BT蝳

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

QQ|撠暺撅||52AV璈A

GMT+8, 2024-4-24 16:56 , Processed in 0.075703 second(s), 16 queries .

蝯∠.撱

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

鋆貉憒 敹恍敺 餈銵