0

I have a large database structure. My hosting plan says I can have unlimited databases but each database is limited to 1 GB.

How can I define a foreign key in one database table to reference a table in another database using MySQL and phpMyAdmin?

Uyghur Lives Matter
  • 18,820
  • 42
  • 108
  • 144
  • I'm not somewhere I can test this, but I'd assume you could specify the foreign key in the `databasename`.`table name` syntax, e.g., something like: ... REFERENCES `databasename`.`table name` (column_name, ...) – Iain Oct 11 '13 at 17:19
  • You may also want to take a look at: http://stackoverflow.com/questions/2132654/querying-multiple-databases-at-once – Iain Oct 11 '13 at 17:20

1 Answers1

1

In the upcoming phpMyAdmin 4.1 (now released as 4.1.0-alpha2), you go to Structure for a table, then Relation view. You then see a panel where you can select other databases for your foreign keys.

Marc Delisle
  • 8,879
  • 3
  • 29
  • 29