我已经安装mysql 5.6在Debian 7.10来自官方 mysql deb 存储库:
deb http://repo.mysql.com/apt/debian/ wheezy mysql-5.6
所以我安装了这些软件包:
# dpkg -l | grep mysql | awk '{print $2 " " $3}' | column -t
libdbd-mysql-perl 4.021-1+b1
libmysqlclient18:amd64 5.6.30-1debian7
mysql-apt-config 0.7.2-1
mysql-client 5.6.30-1debian7
mysql-common 5.6.30-1debian7
mysql-community-client 5.6.30-1debian7
mysql-community-server 5.6.30-1debian7
mysql-server 5.6.30-1debian7
我有cp1251我的系统上安装的区域设置:
# locale -a
ru_RU.cp1251
# echo $LANG
ru_RU.cp1251
并且,我的数据库和与它的连接配置正确:
# mysql
Server version: 5.6.30-log MySQL Community Server (GPL)
(none)>show variables like 'char%';
+--------------------------+----------------------------+
| Variable_name | Value |
+--------------------------+----------------------------+
| character_set_client | cp1251 |
| character_set_connection | cp1251 |
| character_set_database | cp1251 |
| character_set_filesystem | binary |
| character_set_results | cp1251 |
| character_set_server | cp1251 |
| character_set_system | utf8 |
| character_sets_dir | /usr/share/mysql/charsets/ |
+--------------------------+----------------------------+
8 rows in set (0,00 sec)
并且我的 putty 连接已配置为使用cp1251编码。
但是控制台客户端mysql来自包mysql-客户端=5.6.30-1debian7当我输入非拉丁(非 ASCII)符号(字符)时,不会显示任何内容。因此,例如,我可以执行选择语句,其结果正确显示:
# mysql database
Server version: 5.6.30-log MySQL Community Server (GPL)
database> SELECT label FROM users LIMIT 1;
+----------------+
| label |
+----------------+
| админ |
+----------------+
1 row in set (0,00 sec)
但是当我输入语句时“从用户中选择标签,其中标签='админ';”像那样:
database> SELECT label FROM users WHERE label='';
+----------------+
| label |
+----------------+
| админ |
+----------------+
1 row in set (0,00 sec)
它吃绳子阿德明,当我输入它时将其隐藏在我的眼前,但它们仍然在那里,所以请求以正确的结果结束。
如何修复?