Mysql错误问题:ERROR 1005 (HY000): Can't create table 'crm_1.tbl_client' (errno: 150)

Posted 愤怒的绿萝

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Mysql错误问题:ERROR 1005 (HY000): Can't create table 'crm_1.tbl_client' (errno: 150)相关的知识,希望对你有一定的参考价值。

mysql外键创建条件:

1.两个表必须是InnoDB数据引擎
2.外键表的外键字段必须是主键
3.字段类型必须一致

创建表时创建外键:

 create table tbl_client(userName varchar(255) not null, address varchar(255), createDate timestamp not null default now(), createUserName varchar(255), foreign key(createUserName) references tbl_user(userName));



以上是关于Mysql错误问题:ERROR 1005 (HY000): Can't create table 'crm_1.tbl_client' (errno: 150)的主要内容,如果未能解决你的问题,请参考以下文章