mysql里面的utf8,不支持中文吗?
mysql> show variables like '%char%';
+--------------------------+----------------------------------+
| Variable_name | Value |
+--------------------------+----------------------------------+
| character_set_client | utf8 |
| character_set_connection | utf8 |
| character_set_database | utf8 |
| character_set_filesystem | binary |
| character_set_results | utf8 |
| character_set_server | utf8 |
| character_set_system | utf8 |
| character_sets_dir | /usr/local/mysql/share/charsets/ |
+--------------------------+----------------------------------+
8 rows in set (0.00 sec)
mysql>
mysql> insert into t select 1 as a ,'新年好' as b;
ERROR 1366 (HY000): Incorrect string value: '\xD0\xC2\xC4\xEA\xBA\xC3' for column 'b' at row 1
mysql>
mysql> show create table t;
+-------+---------------------------------------------------------------------------------------------------------------------------------+
| Table | Create Table |
+-------+---------------------------------------------------------------------------------------------------------------------------------+
| t | CREATE TABLE `t` (
`a` int(1) NOT NULL DEFAULT '0',
`b` varchar(2) NOT NULL DEFAULT ''
) ENGINE=InnoDB DEFAULT CHARSET=utf8 |
+-------+---------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
mysql>
utf8为啥不支持中文啊,录入不中文字符呢?