Is it possible to reference (InnoDB) a foreign key in another database in MySQL?
Is this bad practice?
Is it possible to reference (InnoDB) a foreign key in another database in MySQL?
Is this bad practice?
Yes, it's possible on the same DB server. Prefix the database name when adding the constraint, e.g. databasename.tablename.fieldname
. Watch your user permissions.
I don't consider it bad practice, though it's not something that should be happening very often.
Hello,
Yes, You can use reference a foreign key in another database in MYSQL.
Thanks.