MySQL Trigger / Federated Tables

31 views Asked by At

I'm struggling to achive this:

I have a mysql server A (w/c is a percona server) and a mysql server B (w/c is also a percona server)

In the mysql server a, I have this database proddb and a table export_transaction (this is an existing table with a 10000 records) In the mysql server b, I also have this database prodb and a table export_transaction ( this is an empty table)

I want to create a trigger that if there is an update of the table in mysql server A export_transaction, it will also update the export_transaction in mysql server B.

the mysql server A and mysql server B are two different servers, with a different ip address.

I wonder if this is possible.

Thank you in advanced.

I tried to implement my idea but it doesn't work with existing tables. I have to recreate the existing table export_transaction in mysql server a.

CREATE TABLE prodb.export_transaction ( -- Define columns here ) ENGINE = FEDERATED CONNECTION = 'mysql://username@server_b_host:3306/prodb/export_transactions';

I don't want to create another server.

0

There are 0 answers