刚学Mysql遇到问题挺多的,希望大家能多多帮忙哦!谢谢了mysql> CREATE TABLE 销售小姐(雇员号 INT,姓名 VARCHAR(40), 佣金 TINYINT );
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '��售小姐(雇员号 INT,姓名 VARCHAR(40), 佣金 TINYINT )' at line 1
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '��售小姐(雇员号 INT,姓名 VARCHAR(40), 佣金 TINYINT )' at line 1
Query OK, 0 rows affected (0.00 sec)mysql> CREATE TABLE 销售小姐(雇员号 INT,姓名 VARCHAR(40), 佣金 TINYINT );
Query OK, 0 rows affected (0.16 sec)mysql> desc 销售小姐;
+--------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+--------+-------------+------+-----+---------+-------+
| 雇员号 | int(11) | YES | | NULL | |
| 姓名 | varchar(40) | YES | | NULL | |
| 佣金 | tinyint(4) | YES | | NULL | |
+--------+-------------+------+-----+---------+-------+
3 rows in set (0.09 sec)mysql>
关于字符集的相关内容,可以参考下贴中的相关部分。
http://blog.csdn.net/ACMAIN_CHM/archive/2009/05/12/4174186.aspx
MySQL 中文显示乱码
-> ;
Query OK, 0 rows affected (0.00 sec)mysql> create table 销售小姐(雇员号 int, 姓名 varchar(40),佣金 tinyint4 );
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '销售小姐(雇员号 int, 姓名 varchar(40),佣金 tinyint4 )' at line 1
Query OK, 0 rows affected (0.00 sec)mysql> insert into `中文表名` values(1);
Query OK, 1 row affected (0.00 sec)mysql> select * from `中文表名`;
+----------+
| 中文字段 |
+----------+
| 1 |
+----------+
1 row in set (0.00 sec)上述用法可以直接拷贝
把字符集设置为这个