Home >Database >Mysql Tutorial >Mysql刷库脚本中带中文,读取出现乱码的问题_MySQL

Mysql刷库脚本中带中文,读取出现乱码的问题_MySQL

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-01 13:42:081045browse

bitsCN.com Mysql刷库脚本中带中文,用Mysql命令登录后刷入数据库后,读取出来出现乱码。 出现的情况有可能是下面的原因:
 安装完mysql没有修改客户端连接编码,默认是latin1,用mysql命令登录进去直接source,
导致刷进去的数据是latin1编码的。   解决方案: 1.mysql命令登录时加参数[html]     mysql --default-character-set=utf8 -u XXX -pXXX   2.修改my.cnf(目录在/etc/my.cnf),在[client]增加如下代码[html]    default-character-set = utf8    作者 fellting bitsCN.com

Statement:
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