52AV璈A|52AV.ONE

 曉撖蝣
 蝡唾酉
敹急瑕
  • av隢憯BBS
  • 璈A
  • 芣瑟憭瘚
  • 鞎澆
  • 52av鋆貉摰
  • 銝剜-銝剖銝餅
  • 伐AI璁函移瘛怠伐
     
亦: 4828|敺: 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').
$ H9 t1 H. P+ T, ~9 `: H% d8 R! e; w1 h6 y5 B9 d8 }/ n
臬歉hp 5.3隞亙撖蝣潭16雿蝺函Ⅳ,啁php 5.3隞亙41雿蝺函Ⅳ,mysql 5.2 隞亙閮凋16蝣,隞交甇斤車航炊.
1 z& s' g0 r8 @! |/ k; l4 t+ g閮箸瑚銝mysql: (php 5.6.38 , mysql 5.1.73)
% W0 h8 Y8 \5 `" x' k餃叮ysql 嗅頛詨 : 6 [( I  r5 U- |' o. u* w& E
mysql> SHOW VARIABLES LIKE 'old_passwords';
; d: C8 N5 k% ^. u+------------------+-------+
" M/ }7 h4 L$ t) d: s: b| Variable_name | Value |
/ e" |( k4 _/ Z1 R+ T; @3 ~+------------------+-------+7 Z% H8 X! ?4 `8 z- r# Z
| old_passwords | ON   |
% _4 V7 h+ k. t5 F+------------------+-------+
) T( |; b- W6 x/ }! c  e( m1 row in set (0.00 sec)
9 @$ M1 E- z* u, [; k, [; u# ?8 E& P0 r5 E& z0 }6 g
old_password  ==> ON  撠梯”蝷 /etc/my.cnf  鋆 old_passwords=1  閮剖16蝣,撠摰閮剔 0 嗅mysqld ==> service mysqld restart
! ?. b) K" R- V8 s/ i  P  v/ l3 r mysql prompt銝頛詨:
$ T2 K% V7 P% H+ }! umysql> SET old_passwords=FALSE;  
5 C" W" @. b' V5 h6 q4 z瑼X叮ysql.user 瘥撖蝣潮瑕漲:7 ^9 q$ c- g# t, `& y
mysql> SELECT 'User', 'Host', Length('Password') FROM mysql.user;
& _3 \2 J: p1 K) N憒瘝寞41雿,Length('Password')甈雿閰脤賣160(銵函內瘝閮剖蝣)
7 _  z% M% s& u; j$ L
; b0 M; B" q/ M6 z, {1 O閮剖靘撖蝣:
% D+ Z! O1 C$ t4 n2 Wmysql> SET PASSWORD FOR 'root'@'192.168.1.1' = PASSWORD('靘撖蝣');    // 撠敹閬詨靘 撣唾@IP 湔,銝閬寥臭
2 x5 M5 ~  m% _" P# ]- R) Pmysql> flush privileges;
/ Y3 B1 w& x& \
. k, Y4 [* _$ G頛詨 SELECT 'User', 'Host', Length('Password') FROM mysql.user; 瑼X亙蝣澆漲,撠勗舐潛曉寧root 撖蝣潮瑕漲撌脫寧41蝣! K* T4 I" M+ [
瘜冽:' n9 S3 a2 o: z8 c8 t
憒撣唾憭芸,臭誑啣憿閮剖蝣,粹閮剖蝣 SET PASSWORD FOR 芷撠亙蝣,銝 old_passwords=0 撠撖蝣潮敶梢
===========================================================================
6 W: o$ a) Z( N" Y2 h鄉ysql蝝 8.0.21,php逅ysql箇2銵errors:
+ {1 f9 i% u7 t8 a) L7 ?/ {mysqli_real_connect(): Server sent charset (255) unknown to the client. Please, report to the developers
* g, C) Z1 |: g4 f4 dmysqli_real_connect(): (HY000/2054): Server sent charset unknown to the client. Please, report to the developers
; z. y8 O% b5 o: G. Y% L. \. n- i:
8 W5 b( ~1 r4 F! U7 G1 |+ R! R
決ySQL 8.0.21銝哨caching_sha2_password舫隤頨思遢撽霅隞塚銝臭誑敺mysql_native_password隞亙php銝詨捆臭誑蝝php嚗銋臭誑靽格遍ySQL蝵柴 曆犖瘙箏靽格遍ySQL蝵:  {* H/ q' _9 G
vi /etc/my.cnf  乩:! p- ~; v1 t8 |# I+ O5 ~& a. K
[mysqld]
* ?1 s- p+ G  r1 x1 ~5 j! r) |& ^9 f1 Y
character-set-server=utf8" g5 a& H; _3 k6 Z4 ^3 _1 {
default_authentication_plugin=mysql_native_password
* M6 }, P3 U, S2 {( c; u/ @: c
; D  N; @2 I9 k. S. |[mysql]
" }2 q; e3 F1 _default-character-set=utf8" k& L' z# F! p; T
+ |. X% u4 q5 r& U" j
[client]7 a3 F1 P0 b9 E" R3 q1 {1 V/ r9 N0 O; I
default-character-set=utf8
+ }+ M1 u% {: l7 ]$ j+ N( X# c( {: u2 H9 q' s
嗅mysqld2 Q# H2 i: w: I5 p
service mysqld restart4 x! i" u/ d/ v* P( i9 j; @& c
摰!!
% B6 E: z  Q) `1 v  @% H9 f( N+ u
( V; N. a. g! f3 d
+ l/ k# p; S- v- M2 h( W3 s$ j$ d

雿輻券

祉蝛閬

撠蝝詨

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

QQ|撠暺撅||52AV璈A

GMT+8, 2025-10-21 10:26 , Processed in 0.058852 second(s), 17 queries .

蝯∠.撱

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

鋆貉憒 敹恍敺 餈銵