您好我想创建在MySQL使用SQL表,但我不断收到error.Here是我的代码:创建表时会引发错误
USE e-commerce
CREATE TABLE `categories` (
`id` SMALLINT NOT NULL AUTO_INCREMENT,
`category` VARCHAR(30) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `category` (`category`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
当我试图在phpMyAdmin SQL控制台运行此得到这个错误:
#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 'CREATE TABLE `categories` (`id` SMALLINT NOT NULL AUTO_INCREMENT, `category` ' at line 2
我在做什么错?
@MahmoudGamal:感谢花花公子。 –