Home > php教程 > php手册 > 我整理的一点关于MySQL4.1的经验

我整理的一点关于MySQL4.1的经验

WBOY
Release: 2016-06-13 10:25:55
Original
1193 people have browsed it

作者: Jeanx
[ 将自遇到的问题解决并和大家一起分享 ]
乱码问题:
在MySQL4.1的安装过程中有缺省character的设置在下图中有显示
如果您所在的服务器有没有选择缺省为GB则会使用UFT8就会出现乱码
或者
只要在你连到数据库后,先执行这句
mysql_query("Set Names uft8");
其中 uft8 可改成你需要的编码,e.g. gb2312 等
这个命令也可以用于 mysql 得命令行,从而可以显示正确的文字
连接数据库出现
-------------------------------------------------------------------------------------------
Client does not support authentication protocol requested
by server; consider upgrading MySQL client
-------------------------------------------------------------------------------------------
由于MySQL 4.1版本开始密码的hash算法改变,所以连接数据库
时可能会出现Client does not support authentication protocol问题。
可以通过一下两种方法解决
其一:
mysql> SET PASSWORD FOR
-> some_user@some_host = OLD_PASSWORD(newpwd);
其二:
mysql> UPDATE mysql.user SET Password = OLD_PASSWORD(newpwd)
-> WHERE Host = some_host AND User = some_user;


mysql> FLUSH PRIVILEGES;
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 Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template