Reputation: 851
I have two database (connections to two servers), database1 and database2. Is there a way for a trigger function in a table in database1 to access a table in database2? If this is possible, how can I do it? Thanks in advance.
Upvotes: 2
Views: 575
Reputation: 5894
I'm not sure about triggers, but in normal queries you can just use the databasename.tablename syntax.
SELECT *
FROM `DatabaseA`.`Table1` t1
INNER JOIN `DatabaseB`.`Table1` t2 ON (`t1`.`id` = `t2`.`id`)
Upvotes: 0
Reputation: 13960
If you are using Mysql Federated Engine, then the answer is yes.
How to create linked server MySQL
Best regards
Upvotes: 3