mysql - referential integrity across multiple databases?
I have two databases in a php / mysql application. One for user data and the other for content.
I have recently had to ma开发者_开发百科ke use of inno db tables in order to enforce some referential integrity. Obviously, the user tables will be required to participate in these relationships.
Is there a way to keep the data separated whilst still maintaining referential integrity?
Any advice appreciated.
Thanks.
If you're really worried about referential integrity between the two sets of data, then they aren't so separate that they should be in separate databases IMO. I would SERIOUSLY consider merging the databases for this.
There's no cross-database way to specify or validate constraints. Either merge the databases or use replication.
精彩评论