0sg04δ0B
mysql> CREATE DATABASE IF NOT EXISTS `shopImooc`;
Query OK, 1 row affected, 1 warning (0.00 sec)
mysql&get; USE `shopImooc`;
Database changed
mysql&get;
mysql&get; -- 管理员表
mysql&get;
mysql&get; DROP TABLAE IF EXISTS `imooc_admin`;
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 'TABLA
E IF EXISTS `imooc_admin`' at line 1
mysql&get; CREATE TABLE `imooc_admin`(
-&get; `id` tinyint unsigned auto_increment key,
-&get; `username` varchar(20) not null unqiue,
-&get; `password` char(32) not null,
-&get; `email` varchar(50) not null
-&get; );
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 'unqiu
e,
`password` char(32) not null,
`email` varchar(50) not null
)' at line 3
mysql&get;
mysql&get; -- 分类表
mysql&get;
mysql&get; DROP TABLE IF EXISTS `imooc_cate`;
Query OK, 0 rows affected, 1 warning (0.00 sec)
mysql&get; CREATE TABLE `imooc_cate`(
-&get; `id` smallint unsigned auto_increment,
-&get; `cName` varchar(50) not null unique
-&get; );
ERROR 1075 (42000): Incorrect table definition; there can be only one auto colum
n and it must be defined as a key
mysql&get; -- 商品表
mysql&get;
mysql&get; DROP TABALE IF EXISTS `imooc_pro`;
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 'TABAL
E IF EXISTS `imooc_pro`' at line 1
mysql&get; CREATE TABLE `imooc_pro`(
-&get; `id` int unsigned auto_increment key,
-&get; `pName` varchar(50) not null unique,
-&get; `pSn` varchar(50) not null,
-&get; `pNum` int unsigned default 1,
-&get; `mPrice` decimal(10,2) not null,
-&get; `iPrice` decimal(10,2) not null,
-&get; `pDesc` text,
-&get; `pImg` varchar(50) not null,
-&get; `pubTime` int unsigned not null,
-&get; `isShow` tinyint(1) default 1,
-&get; `isHot` tinyint(1) default 0,
-&get; `cId` smallint unsigned not null
-&get; );
ERROR 1050 (42S01): Table 'imooc_pro' already exists
mysql&get; -- 用户表
mysql&get;
mysql&get; DROP TABLE IF EXISTS `imooc_user`;
Query OK, 0 rows affected, 1 warning (0.00 sec)
mysql&get; CREATE TABLE `imooc_user`(
-&get; `id` int unsigned auto_increment key,
-&get; `username` varchar(20) not null unique,
-&get; `password` char(32) not null,
-&get; `sex` enum ("男","女","保密") not null default "保密",
-&get; `face` varchar(50) not null,
-&get; `regTime` int unsigned not null,
-&get; );
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 ')' at
line 8
mysql&get; -- 相册表
mysql&get;
mysql&get; DROP TABLE IF EXISTS `imooc_album`;
Query OK, 0 rows affected (0.04 sec)
mysql&get; CREATE TABLE `imooc_album`(
-&get; `id` int unsigned auto_increment key,
-&get; `pid` int unsigned not null,
-&get; `albumPath` varchar(50) not null
-&get; );
Query OK, 0 rows affected (0.07 sec)
mysql&get;
mysql&get; show tables;
+---------------------+
| Tables_in_shopimooc |
+---------------------+
| imooc_album |
| imooc_pro |
+---------------------+
2 rows in set (0.00 sec)
谁能帮我看下mysql报错啊
建了五个表,只有两个成功了,不知道错在哪里,有:)指点吗