使用Navicat V8.0创建数据库,外键出现错误ERROR 1005: Can't create table (errno: 121)

当尝试创建表时遇到ERROR 1005 (errno 121),通常是由于表已存在、.frm文件残留或外键约束名称冲突。解决方法是检查并确保主键名在整个数据库中唯一,或者更改外键约束的名称。通过更改变量名,成功解决了建表问题。
摘要由CSDN通过智能技术生成

ERROR 1005: Can't create table (errno: 121)

errno 121 means a duplicate key error. Probably the table already exists in the InnoDB internal data dictionary, though the .frm file for the table has been deleted. This is the most common reason for getting errno 121 in table creation. Another possible reason is a name conflict in a foreign key constraint name. Constraint names must be unique in a database, like table names are.


意思是:

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值