Transfer Mysql table data to client Server via TCP/IP by using Trigger [closed]
-
19-02-2021 - |
Question
i Have Database on MySQL Server. I have one Table so called "log" in Database. Data has been insert in Database table automatic. I would like to transfer table via TCP/IP to the another Software. Whenever new row has been added. It should show me also in Software. I can Connect MySQL server from Software. But i don't know how to exchange information between them. It should be possible with trigger. Whenever new Row has been added then the trigger send information to the client(in my case Software). But when someone has idea about it. It would be very helpful. Thank You,
Solution
I would not do this using a trigger but rather use MySQL replication. You can configure the 'master' or first database to only replicate the one table using replicate-do-table=db_name.log which you can set in my.cnf
Make the target database a slave of the first database and these changes will be replicated using the proper MySQL features.
replicate-do-table
IMO the suggested trigger is a bit of a hack and more prone to silent failure than the replication option.