I want to create a MYSQL Stored procedure when I insert data into the table, the data will get inserted in other server table too.
I know this is possible in ORACLE databases but I don't know if It works in MYSQL.
Is there any way to do this ?
I want to create a MYSQL Stored procedure when I insert data into the table, the data will get inserted in other server table too.
I know this is possible in ORACLE databases but I don't know if It works in MYSQL.
Is there any way to do this ?
Yes this is possible in MySQL using following approaches:
Table Federation: Create a new federated table same as main table having ENGINE=FEDERATED
which will have a MySQL connection string username password and host id of other server. Onother server you need to create a new user and give insert grants to this user.
Write a TRIGGER
on main table and AFTER INSERT
on main table insert into federated table.
Replication: Setup a replication from server1 (MASTER) to server2 (SLAVE) and add this table in replication.
Do you want to replicate all data (in the table) between a number of databases periodically?
http://dev.mysql.com/doc/refman/5.0/en/replication.html
or do you want to propagate an insert?
your answer may be in