mysql
mysql> show variables like '%char%';
+--------------------------+----------------------------------+
| Variable_name | Value |
+--------------------------+----------------------------------+
| character_set_client | latin1 |
| character_set_connection | latin1 |
| character_set_database | latin1 |
| character_set_filesystem | binary |
| character_set_results | latin1 |
| character_set_server | latin1 |
| character_set_system | utf8 |
| character_sets_dir | /app/mysql/share/mysql/charsets/ |
+--------------------------+----------------------------------+
mysql> show variables like '%collation%';
+----------------------+-------------------+
| Variable_name | Value |
+----------------------+-------------------+
| collation_connection | latin1_swedish_ci |
| collation_database | latin1_swedish_ci |
| collation_server | latin1_swedish_ci |
+----------------------+-------------------+
linux 系统
# echo $LANG
en_US.UTF-8
mysql server编码不能修改,因为不少是之前的老业务,这种情况下想在linux终端上查询显示中文,用的终端是securecrt
一个简单的方法:
将securecrt中字符编码设置成GB18030,这个时候在linux终端执行查询命令
mysql -p -S /tmp/mysql.sockxxx dbname -e "SELECT * FROM tbname where playername='测试测试'";
结果即可显示中文
阅读(945) | 评论(0) | 转发(0) |