Jump to content

Recommended Posts

Posted

Hi, is there any way to create a foreign key linked to another database? I can't see all the databases in PMA.

Posted

This does not appear to be supported on Plesk (though it technically is possible in mariadb). It's generally considered to be poor practice anyway, insomuch that mysql/mariadb is one of the only major engines that even supports it. Postgres and SQL Server expressly refuse to support this (in Postgres you can do it between schemas but not databases, and sql server simply has no support at all, you need to use triggers).

Allowing this actually causes all sorts of issues with database integrity too, for example, what happens if one of the two databases goes missing or is rolled back to a backup?

  • Like 1
Posted

@wolstech Okay, I got your point. But I have a centralized login system for all the services/platforms which uses a database called "members" and the tables (specifically, "accounts") in it and a specific column of that table namely "uid" as a foreign key relation, i.e. if a row of that table is deleted this would delete all the information located throughout all other databases related to the "uid".

Please let me know if there are any other ways to achieve this.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...