MySQL“错误1005"添加表格时 [英] MySQL "Error 1005" when adding tables

查看:84
本文介绍了MySQL“错误1005"添加表格时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近一直在使用MySQL数据库,并使用MySQL工作台设计数据库.

I've recently been working with a MySQL database, and using MySQL workbench to design the Database.

当我使用导出到SQL函数时,实际上可以将布局获取到数据库中,我得到:

When I use the export to SQL function, so I can actually get the layout in to the Database, I get:

错误1005:无法创建表"

"Error 1005: Cannot create table"

这似乎与create table语句中的外键有关.

This appears to be related to Foreign Keys in the create table statement.

有人能解决这个问题,而不必排除约束并将其放回去吗?考虑到数据库的大小,这不是理想的解决方案.

Does anybody have a work around for this that doesn't involve taking the constraints out and putting them back in later? That's a less than ideal solution given the size of the database.

推荐答案

出现此问题(以及InnoDB引擎产生的其他错误)时:

When you get this (and other errors out of the InnoDB engine) issue:

SHOW ENGINE INNODB STATUS;

它将给出无法完成操作的更详细的原因.由于响应时间很长,请确保从允许您滚动或复制数据的操作中运行该程序.

It will give a more detailed reason why the operation couldn't be completed. Make sure to run that from something that'll allow you to scroll or copy the data, as the response is quite long.

这篇关于MySQL“错误1005"添加表格时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆