Is it possible to create a MySQL stored procedure that can execute a given insert or update and then also have it connect to a 2nd server and run the same commands? I want to basically call one server and in real-time have it backup to the second server. Just a yah or ney would suffice unless you have a link or two handy or another solution.
Thank you for your time. Aaron
You could but only under 3 specific conditions:
The second table you are updating on another server is:
First, make sure you have the FEDERATED engine enabled in MySQL
Just run
SHOW ENGINES;
If the FEDERATED storage engine does not exist or is disabled, read no further.
Otherwise, you can try this out by writing it as an INSERT AFTER and an UPDATE AFTER trigger.
For this example:
this_db
with tablethis_table
that_db
with tablethat_table
10.20.30.250
Table structure looks like this:
First, make sure the table structures are MyISAM and identical...
On the first server, do
SHOW CREATE TABLE this_db.this_table\G
On the other server, do
SHOW CREATE TABLE that_db.that_table\G
On the first server, run this:
On the first server, run this:
On the first server, create an INSERT AFTER trigger against
this_db.this_table
:On the first server, create an UPDATE AFTER trigger against
this_db.this_table
:That's it.
Give it a try!!!