-3

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,

1

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.

2
  • Anyway, a TRIGGER cannot write outside MySQL. – Rick James Nov 30 '19 at 1:19
  • It’s possible to rig up something with a trigger and a federated table. It would not be a solution I would want, but it is possible. – pixiemops Nov 30 '19 at 22:41

Not the answer you're looking for? Browse other questions tagged or ask your own question.