mysqldbcopy结合外键约束? [英] mysqldbcopy combining foreign key constraints?

查看:107
本文介绍了mysqldbcopy结合外键约束?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我目前有一个根据SHOW CREATE TABLE具有以下约束的表:

So I currently have a table that has the following constraints according to SHOW CREATE TABLE:

CONSTRAINT `FK_BA62400997790DEE` FOREIGN KEY (`some_id`) REFERENCES `Other_Table` (`id`),
CONSTRAINT `FK_BA624009C8554709` FOREIGN KEY (`someOther_id`) REFERENCES `Yet_Another_Table` (`id`)

但是,当使用mysqldbcopy复制数据库时,出现以下错误:

However, when using mysqldbcopy to copy the db over, I get the following error:

ALTER TABLE old_database.OriginalTable add CONSTRAINT `FK_BA62400997790DEE`
FOREIGN KEY (`some_id`,`someOther_id`)
REFERENCES `old_database`.`Other_Table`
(`id`,`id`)
ON UPDATE RESTRICT
ON DELETE RESTRICT
. Error: Query failed. 1005 (HY000): Can't create table 'old_database.#sql-602_4b5' (errno: 150)

这里显然有问题,但不确定是什么.显然,要以某种方式尝试组合键?

Something is clearly going wrong here, but not sure what it is. Clearly it's somehow trying to combine the keys?

我正在运行1.3.5版.

I am running version 1.3.5.

推荐答案

1.3.6版本修复了以下可能与之相关的错误

The 1.3.6 release fixed the following bug which may be related

BUG#17474810: constraint error copying the employees with mysqldbcopy

尝试升级到更高版本,当前最新版本为1.6- https://launchpad.net/mysql-utilities

Try upgrading to something higher, currently up to version 1.6 - https://launchpad.net/mysql-utilities

这篇关于mysqldbcopy结合外键约束?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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