标题: PHP编程:PHP 5 毗连 mysql 5 的认证协定成绩 [打印本页] 作者: 飘飘悠悠 时间: 2015-2-4 00:30 标题: PHP编程:PHP 5 毗连 mysql 5 的认证协定成绩 一些真正的强人总会搞出新玩意来丢给你,你不学就落后了,也印证了前人的经验,果然是学无止境啊!mysql|成绩 MYSQL 4.1今后, 采取了一种新的用户认证协定, 关于老的客户端会呈现不撑持认证协定的毛病, 以下是官方网站的处理办法r
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
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 you'll 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.