欢迎光临
我们一直在努力

PHP 5 连接 mysql 5 的认证协议问题-PHP教程,PHP应用

建站超值云服务器,限时71元/月

mysql 4.1以后, 采用了一种新的用户认证协议, 对于老的客户端会出现不支持认证协议的错误, 以下是官方网站的解决方法﹔

1upgrade all client programs to use a 4.1.1 or newer client library.

更新客户端库,这需要更新php的扩展库,对于老的api php已经不提供了这样的扩展库了

2when connecting to the server with a pre-4.1 client program, use an account that still has a pre-4.1-style password.

使用以前建立的账号连接,对于在新的认证协议下建立的账户就不行了

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_password() function: mysql> set password for

-> some_user@some_host = old_password(newpwd);

alternatively, use update and flush privileges: mysql> update mysql.user set password = old_password(newpwd)

-> where host = some_host and user = some_user;

mysql> flush privileges;

substitute the password you want to use for “newpwd in the preceding examples. mysql cannot tell you what the original password was, so youll need to pick a new one.

这是一个不错的办法,新建立的账号采用老式的加密协议

4tell the server to use the older password hashing algorithm:

start mysqld with the –old-passwords option.

这样新认证协议的优点就没法使用了

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: mysql> select host, user, password from mysql.user

-> where length(password) > 16;

for each account record displayed by the query, use the host and user values and assign a password using the old_password() function and either set password or update, as described earlier.

赞(0)
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com 特别注意:本站所有转载文章言论不代表本站观点! 本站所提供的图片等素材,版权归原作者所有,如需使用,请与原作者联系。未经允许不得转载:IDC资讯中心 » PHP 5 连接 mysql 5 的认证协议问题-PHP教程,PHP应用
分享到: 更多 (0)

相关推荐

  • 暂无文章