错误现象如下:-bash-3.00$ ./mysql -h10.3.3.100 -P3306 -unds -pnds nds
./mysql: Character set 'gb2312' is not a compiled character set and is not specified in the '/DEVHome/aimcpkg/3rd/mysql-5.1.26/share/mysql/charsets/Index.xml' file连接mysql服务时,默认读取配置文件/etc/my.cnf
刚好/etc/my.cnf 设置了
[client]
default-character-set=gb2312屏蔽掉 default-character-set=gb2312 既可连接了。
./mysql: Character set 'gb2312' is not a compiled character set and is not specified in the '/DEVHome/aimcpkg/3rd/mysql-5.1.26/share/mysql/charsets/Index.xml' file连接mysql服务时,默认读取配置文件/etc/my.cnf
刚好/etc/my.cnf 设置了
[client]
default-character-set=gb2312屏蔽掉 default-character-set=gb2312 既可连接了。
default-character-set=utf8
很显然你的服务器上安装的MYSQL根本不支持gb2312字符集。
是的。会自动转换。你可以看一下这个贴子http://blog.csdn.net/ACMAIN_CHM/archive/2009/05/12/4174186.aspx
MySQL 中文显示乱码