4 回答
TA贡献3条经验 获得超1个赞
你自己的语句:
mysql> CREATE TABLE IF NOT EXISTS rr_category( cid TINYINT UNSIGNED AUTO_INCREMENT, c_name VARCHAR, parentid TINYINT UNSIGNED, PRIMARY KEY (cid) );
执行后报这个错误:
1064 - 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 ' parentid TINYINT UNSIGNED, PRIMARY KEY (cid) )' at line 1
修改后的语句(采取“Hadooper”的提示):
mysql> CREATE TABLE IF NOT EXISTS rr_category( cid TINYINT UNSIGNED AUTO_INCREMENT, c_name VARCHAR(20), parentid TINYINT UNSIGNED, PRIMARY KEY (cid) );
执行后的提示:
Query OK, 0 rows affected
查看结果:
mysql> show tables;
+----------------+
| Tables_in_test |
+----------------+
| rr_category |
| users |
+----------------+
6 rows in set
添加回答
举报