Bug #6457 FK between tables located in different databases
Submitted: 5 Nov 2004 9:44 Modified: 5 Nov 2004 14:39
Reporter: Mickael Besson Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S4 (Feature request)
Version:4.1.7 OS:Windows (Windows NT 4)
Assigned to: CPU Architecture:Any

[5 Nov 2004 9:44] Mickael Besson
Description:

It will very usefull if FK worked through different databases, like Oracle.

Syntax coulb be :

CONSTRAINT `my_fk` FOREIGN KEY (`PER_MAT`) REFERENCES `other_db`.`rfg_per` (`PER_MAT`)

or

rfg_per@other_db (PER_MAT)

How to repeat:
nothing to repeat

Suggested fix:
no
[5 Nov 2004 14:39] Heikki Tuuri
Hi!

InnoDB FOREIGN KEYs do work over different databases. Just put the database name plus period '.' before the table name.

E.g.,

...REFERENCES test.mytable(a)

Regards,

Heikki
[5 Nov 2004 15:29] Mickael Besson
OK Thank you.
So you could add this functionnality into MySQL Administrator, in MySQL Table editor