命令行连接mysql1064_用navicat for mysql的命令行建表时出现1064

在使用Navicat for MySQL的命令行模式创建名为'order'的表时遇到1064错误。错误信息提示SQL语法错误。表结构包括id、bookid、userid、number、address、postcode、orderdate、status等字段,同时定义了外键约束。错误出现在SQL语句的第3行。
摘要由CSDN通过智能技术生成

createtableorder->(idint(10)unsignednotnullauto_increment,->bookidint(10)unsignednotnulldefault'0',->useridint(10)unsignednotnulldefault'0',->numbertinyint(3)unsignednotn...

create table order

-> (id int(10) unsigned not null auto_increment,

-> bookid int(10) unsigned not null default '0',

-> userid int(10) unsigned not null default '0',

-> number tinyint(3) unsigned not null default '0',

-> address varchar(128) not null default '',

-> postcode varchar(6) not null default '',

-> orderdate datetime not null default '0000-00-00 00:00:00',

-> status tinyint(3) unsigned zerofill not null default '000',

-> primary key(id),

-> key fk_order_1 (bookid),

-> key fk_order_2 (userid),

-> constraint fk_order_1 foreign key (bookid) references bookinfo (id),

-> constraint fk_order_2 foreign key (userid) references userinfo (id))

-> ;

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 order

(id int(10) unsigned not null auto_increment,

bookid ' at line 3

展开

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值