请教关于MySQL里的CREATE TABLE的问题。请问如下建表语句那里出错了,问什么执行不了呢?谢谢!
建表语句:mysql>CREATETABLEIFNOTEXISTScompany_user(->idint(10)UNSIGNEDAUTO_INCREMENTNOTNUL...
建表语句:
mysql> CREATE TABLE IF NOT EXISTS company_user(
-> id int(10) UNSIGNED AUTO_INCREMENT NOT NULL PRIM
ARY KEY,
-> username VARCHAR(24) NOT NULL UNIQUE,
-> password VARCHAR(8) NOT NULL,
-> company_name VARCHAR(300) NOT NULL UNIQUE,
-> company_type VARCHAR(30) NOT NULL,
-> company_intro TEXT DEFAULT,
-> office_image TEXT,
-> register_date DATE NOT NULL
-> )ENGINE=InnoDB DEFAULT CHARSET utf8 COLLATE utf8_general_ci;
系统报错:
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 '
office_image TEXT,
register_date DATE NOT NULL
)ENGINE=InnoDB DEFAU' at line 7 展开
mysql> CREATE TABLE IF NOT EXISTS company_user(
-> id int(10) UNSIGNED AUTO_INCREMENT NOT NULL PRIM
ARY KEY,
-> username VARCHAR(24) NOT NULL UNIQUE,
-> password VARCHAR(8) NOT NULL,
-> company_name VARCHAR(300) NOT NULL UNIQUE,
-> company_type VARCHAR(30) NOT NULL,
-> company_intro TEXT DEFAULT,
-> office_image TEXT,
-> register_date DATE NOT NULL
-> )ENGINE=InnoDB DEFAULT CHARSET utf8 COLLATE utf8_general_ci;
系统报错:
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 '
office_image TEXT,
register_date DATE NOT NULL
)ENGINE=InnoDB DEFAU' at line 7 展开
展开全部
CREATE TABLE IF NOT EXISTS company_user(
id int(10) UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
username VARCHAR(24) NOT NULL UNIQUE,
password VARCHAR(8) NOT NULL,
company_name VARCHAR(250) NOT NULL UNIQUE,
company_type VARCHAR(30) NOT NULL,
company_intro TEXT,
office_image TEXT,
register_date DATE NOT NULL
)ENGINE=InnoDB DEFAULT CHARSET utf8 COLLATE utf8_general_ci;
id int(10) UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
username VARCHAR(24) NOT NULL UNIQUE,
password VARCHAR(8) NOT NULL,
company_name VARCHAR(250) NOT NULL UNIQUE,
company_type VARCHAR(30) NOT NULL,
company_intro TEXT,
office_image TEXT,
register_date DATE NOT NULL
)ENGINE=InnoDB DEFAULT CHARSET utf8 COLLATE utf8_general_ci;
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询
广告 您可能关注的内容 |