Home > Database > Mysql Tutorial > body text

配置mysql odbc出现错误的解决

WBOY
Release: 2016-06-07 16:52:04
Original
1450 people have browsed it

出现ldquo;Client does not support authentication protocol requested by serverrdquo;?安装Mysql4.1以上版本出现ldquo;Cl

出现“Client does not support authentication protocol requested by server”?

安装Mysql4.1以上版本出现“Client does not support authentication protocol requested by server”.

Mysql 4.1及以上版本使用了新的密码算法,而PHP不支持新算法,因此在新增用户后,还需要用下面的方法解决PHP无法连接登录Mysql的问题: (其中some_user,some_host,newpwd分别是您数据库的用户名,主机,密码)

第一种解决方法:

mysql> SET PASSWORD FOR

-> 'some_user'@'some_host' = OLD_PASSWORD('newpwd');

比方说数据库用户是admin,主机localhost,,密码是123456

这时候输入的命令应该是:

mysql> SET PASSWORD FOR admin@localhost=OLD_PASSWORD('123456');

第二种解决方法:

mysql> UPDATE mysql.user SET Password = OLD_PASSWORD('newpwd')

-> WHERE Host = 'some_host' AND User = 'some_user';

mysql> FLUSH PRIVILEGES;

第三种解决方法(不推荐)

用 --old-passwords 选项启用 mysqld,然后用上面的方法更改原有用户

linux

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template