简体   繁体   English

如何在MySQL和phpMyAdmin中的两个不同数据库中定义外键

[英]How to define foreign key in two different databases in MySQL and phpMyAdmin

I have a large database structure. 我的数据库结构很大。 My hosting plan says I can have unlimited databases but each database is limited to 1 GB. 我的托管计划说,我可以有无限的数据库,但是每个数据库都限制为1 GB。

How can I define a foreign key in one database table to reference a table in another database using MySQL and phpMyAdmin? 如何使用MySQL和phpMyAdmin在一个数据库表中定义外键以引用另一个数据库中的表?

In the upcoming phpMyAdmin 4.1 (now released as 4.1.0-alpha2), you go to Structure for a table, then Relation view. 在即将发布的phpMyAdmin 4.1(现在发布为4.1.0-alpha2)中,转到“结构”表,然后进入“关系”视图。 You then see a panel where you can select other databases for your foreign keys. 然后,您会看到一个面板,您可以在其中选择其他数据库作为外键。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM