首页 新闻 会员 周边

mysql5.7 创建表外键失败 求看下!!!! 折磨我一天了?

0
[待解决问题]

···
create table trkr_admin(
id tinyint unsigned not null auto_increment primary key comment '管理员ID编号',
name CHAR(30) not null default '' comment '管理员账号',
cname CHAR(30) not null default '' comment '管理员昵称',
password char(32) not null default '' comment '管理员密码',
status tinyint not null default '1' comment '账号状态 1开启 2关闭',
UNIQUE(name),
UNIQUE(cname),
index(name)
)engine=InnoDB charset=utf8mb4;

create table trkr_article(
id int unsigned not null auto_increment primary key comment '文章ID编号',
title char(20) not null default '' comment '文章标题名称',
content varchar(16000) not null default ' ' comment '文章的内容',
bind_adminname_id tinyint unsigned not null comment '发表文章的作者外键',
FOREIGN KEY(bind_adminname_id) REFERENCES trkr_admin(id),
FULLTEXT (title,content) WITH PARSER ngram
)engine=InnoDB charset=utf8mb4;
···
提交后就出现错误!!!!! 1215错误 意思应该是类型不对称!!!

海强大叔的主页 海强大叔 | 初学一级 | 园豆:106
提问于:2018-08-02 16:32
< >
分享
所有回答(2)
0
dudu | 园豆:30994 (高人七级) | 2018-08-02 16:49
0

我那你的语句,去掉那个fulltext部分 创建成功了!

版本 5.1.73。

你的表是不是已经有数据了,不合规。还是版本问题?

jinzhenshui | 园豆:383 (菜鸟二级) | 2018-08-06 08:38
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册