QQ登录

只需要一步,快速开始

 注册地址  找回密码
查看: 3344|回复: 0
打印 上一主题 下一主题

PHP 5 连接 mysql 5的认证协议问题

[复制链接]
字体大小: 正常 放大
韩冰        

823

主题

3

听众

4048

积分

我的地盘我做主

该用户从未签到

发帖功臣 元老勋章

跳转到指定楼层
1#
发表于 2005-1-20 14:49 |只看该作者 |倒序浏览
|招呼Ta 关注Ta
<><FONT color=#f70909>来源:LinuxAid</FONT> </P>; `: g' h" A- d/ }
<>MYSQL 4.1以后, 采用了一种新的用户认证<a href="http://hackbase.com/network/protocol" target="_blank" >协议</A>, 对于老的客户端会出现不支持认证<a href="http://hackbase.com/network/protocol" target="_blank" >协议</A>的错误, 以下是官方网站的解决方法 r    </P>
1 X( Z8 z, j: \8 f1 Y! `<>  1Upgrade all client programs to use a 4.1.1 or newer client library.    </P>) q  B1 @3 V/ q) x! |* M% x
<>  更新客户端库,这需要更新PHP的扩展库,对于老的api PHP已经不提供了这样的扩展库了    </P>5 T) I0 M/ s* v1 c0 y, e
<>  2When connecting to the server with a pre-4.1 client program, use an account that still has a pre-4.1-style password.    </P>
5 p. j2 t; n/ [' z+ g3 M<>  使用以前建立的账号连接,对于在新的认证<a href="http://hackbase.com/network/protocol" target="_blank" >协议</A>下建立的<a href="http://hackbase.com/skill" target="_blank" >账户</A>就不行了    </P>
: K# R, e$ }3 `5 d/ c<>  3Reset the password to pre-4.1 style for each user that needs to use a pre-4.1 client program. This can be done using the SET PASSWORD statement and the OLD<a href="http://www1.hackbase.com/network/server/200501209617.htm#" target="_blank" >_</A>ASSWORD() function: my<a href="http://hackbase.com/hacker" target="_blank" >sql</A>&gt; SET PASSWORD FOR </P>. B' s$ ^) o* Q* i. u0 ?9 m
<>  -&gt; <a href=" target="_blank" >_</A>user'@'some<a href="http://www1.hackbase.com/network/server/200501209617.htm#" target="_blank" >_</A>host'"&gt;'some<a href="http://www1.hackbase.com/network/server/200501209617.htm#" target="_blank" >_</A>user'@'some<a href="http://www1.hackbase.com/network/server/200501209617.htm#" target="_blank" >_</A>host'</A> = OLD<a href="http://www1.hackbase.com/network/server/200501209617.htm#" target="_blank" >_</A>ASSWORD('newpwd');    </P>
2 J( i& m- e7 u) r# X2 ^' e<>  Alternatively, use UPDATE and FLUSH PRIVILEGES: my<a href="http://hackbase.com/hacker" target="_blank" >sql</A>&gt; UPDATE my<a href="http://hackbase.com/hacker" target="_blank" >sql</A>.user SET Password = OLD<a href="http://www1.hackbase.com/network/server/200501209617.htm#" target="_blank" >_</A>ASSWORD('newpwd') -&gt; WHERE Host = 'some<a href="http://www1.hackbase.com/network/server/200501209617.htm#" target="_blank" >_</A>host' AND User = 'some<a href="http://www1.hackbase.com/network/server/200501209617.htm#" target="_blank" >_</A>user'; </P>
& f: I3 ?5 a8 N; h' u$ P; ^9 T<>  my<a href="http://hackbase.com/hacker" target="_blank" >sql</A>&gt; FLUSH PRIVILEGES;    </P>
; Z& }4 o* L0 p/ f% ^, A. w: [/ w  k9 d<>  Substitute the password you want to use for ``newpwd'' in the preceding examples. MySQL cannot tell you what the original password was, so you'll need to pick a new one.   </P>
5 R$ h- f" l7 ~3 O<>  这是一个不错的办法,新建立的账号采用老式的加密<a href="http://hackbase.com/network/protocol" target="_blank" >协议</A>    </P>+ b/ Y; D5 [$ P' J2 r% A
<>  4Tell the server to use the older password hashing algorithm: </P>. K% Y' U4 ], i, K" J6 H( u5 g
<>  Start my<a href="http://hackbase.com/hacker" target="_blank" >sql</A>d with the --old-passwords option.   </P>6 [( q0 z  q; m$ x0 U% {- i/ ~
<>  这样新认证<a href="http://hackbase.com/network/protocol" target="_blank" >协议</A>的优点就没法使用了    </P>
( W8 V; l4 E, e9 n<>  5Assign an old-format password to each account that has had its password updated to the longer 4.1 format. You can identify these accounts with the following query: my<a href="http://hackbase.com/hacker" target="_blank" >sql</A>&gt; SELECT Host, User, Password FROM my<a href="http://hackbase.com/hacker" target="_blank" >sql</A>.user </P>2 t2 d" C7 D1 R; e! E; ]% s
<>  -&gt; WHERE LENGTH(Password) &gt; 16;    </P>' B; `( M) ?' ?: h' ]
<>  For each account record displayed by the query, use the Host and User values and assign a password using the OLD<a href="http://www1.hackbase.com/network/server/200501209617.htm#" target="_blank" >_</A>ASSWORD() function and either SET PASSWORD or UPDATE, as described earlier.    </P>) H' z: N1 s) q+ I) \4 A- a- z& H
<>  恢复已经升级了口令到老样式    </P>
+ O7 ^5 b0 S2 O* ]<>  本文参照了 <a href="http://dev.my<a%20href=/" target="_blank" >sql</A>.com/doc/my<a href="http://hackbase.com/hacker" target="_blank" >sql</A>/en/Old<a href="http://www1.hackbase.com/network/server/200501209617.htm#" target="_blank" >_</A>client.html"&gt;http://dev.my<a href="http://hackbase.com/hacker" target="_blank" >sql</A>.com/doc/my<a href="http://hackbase.com/hacker" target="_blank" >sql</A>/en/Old<a href="http://www1.hackbase.com/network/server/200501209617.htm#" target="_blank" >_</A>client.html</A> </P>/ [' T- q+ ^8 @; J+ `. n4 k; Y
<>
4 }9 @' Y! j; Y, z1 [8 N" _1 F9 A. h<CENTER></CENTER>
zan
转播转播0 分享淘帖0 分享分享0 收藏收藏0 支持支持0 反对反对0 微信微信
您需要登录后才可以回帖 登录 | 注册地址

qq
收缩
  • 电话咨询

  • 04714969085
fastpost

关于我们| 联系我们| 诚征英才| 对外合作| 产品服务| QQ

手机版|Archiver| |繁體中文 手机客户端  

蒙公网安备 15010502000194号

Powered by Discuz! X2.5   © 2001-2013 数学建模网-数学中国 ( 蒙ICP备14002410号-3 蒙BBS备-0002号 )     论坛法律顾问:王兆丰

GMT+8, 2026-10-8 06:28 , Processed in 0.913188 second(s), 52 queries .

回顶部