匿名用户
1级
-11-18 回答
中文字段名都可以了 但是中文记录不行 奇怪啊
mysql>; create table a (a char(20));
Query OK, 0 rows affected (0.05 sec)
mysql>; insert into a values('^_^');
Query OK, 1 row affected (0.05 sec)
mysql>; insert into a values('中guo');
Query OK, 1 row affected (0.05 sec)
mysql>; insert into a values('中国');
Query OK, 1 row affected (0.05 sec)
mysql>; insert into a values('中');
Query OK, 1 row affected (0.01 sec)
mysql>; select * from a;
+-------+
| a |
+-------+
| ^_^ |
| ??guo |
| ???? |
| ?? |
+-------+
4 rows in set (0.00 sec)
mysql>; create table t2 (中 char(20));
Query OK, 0 rows affected (0.05 sec)
mysql>; insert into t2 values('"中guo"');
Query OK, 1 row affected (0.03 sec)
mysql>; select * from t2;
+---------+
| 中 |
+---------+
| "??guo" |
+---------+
1 row in set (0.00 sec)
mysql>; status;
--------------
mysql Ver 14.7 Distrib 4.1.7, for Win95/Win98 (i32)
Connection id: 2
Current database: test1
Current user: root@localhost
SSL: Not in use
Using delimiter: ;
Server version: 4.1.7-nt
Protocol version: 10
Connection: localhost via TCP/IP
Server characterset: latin1
Db characterset: gbk
Client characterset: gb2312
Conn. characterset: latin1
TCP port: 3306
Uptime: 35 min 18 sec
Threads: 1 Questions: 43 Slow queries: 0 Opens: 21 Flush tables: 1 Open tables: 2 Queries per second avg: 0.020
如果觉得《mysql 字段 中文_如何配置mysql支持中文字段名与中文字段》对你有帮助,请点赞、收藏,并留下你的观点哦!