mysql>set password for 'root'@'localhost' = old_password('newpassword');
解决方案 »
- 如何将“一个时区的时间”转成“另一个时区的时间”?
- 怎样在一篇文章中间插入广告?
- php+mysql站内搜索+分页
- 这个二维数组怎么实现。应该用foreach循环。
- thinkphp自带的分页,当前页是什么?
- [100分]请问如何在php中使用代理来读取一个远程url?
- 如何限制一个用户只能登陆一次
- 遇到一难题,请大家帮忙!在线等喽!
- 那句应该不是什么关键问题 , 事实上有ScriptAlias /php4/ "d:/php4/php.exe/时, 还是可以让php 运行。!
- php webservice交互在nginx上参数传不过去
- php怎样实现自动播放的功能,且时间是自己设定的?
- 如何解决验证的问题?解决者另开贴给分
好多朋友升级了mysql为4.10以上会发生此错误,php4.x下phpmyadmin之类的程序连接不上数据库,是因为mysql4.10以上改变了用户密码验证协议,php的连接模块也需要更换新的,php5默认就是这种新的连接模块...不想更换可以这样:
CODE
# SET PASSWORD FOR 'some_user'@'some_host' = OLD_PASSWORD('newpwd');
# FLUSH PRIVILEGES;
官方说明文档:
CODE
Client does not support authentication protocol
MySQL 4.1 and up uses an authentication protocol based on a password hashing algorithm that is incompatible with that used by older clients. If you upgrade the server to 4.1, attempts to connect to it with an older client may fail with the following message: shell> mysql
Client does not support authentication protocol requested
by server; consider upgrading MySQL client To solve this problem, you should use one of the following approaches: Upgrade all client programs to use a 4.1.1 or newer client library. When connecting to the server with a pre-4.1 client program, use an account that still has a pre-4.1-style password. Reset 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 you'll need to pick a new one. Tell the server to use the older password hashing algorithm: Start mysqld with the --old-passwords option. Assign 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.
$conn = mysql_connect("localhost","root","");
mysql_select_db("test",$conn);
...?>