How to update a table automatically as another table is updated on different mysql server?

前端 未结 2 448
南方客
南方客 2021-01-23 13:28

Let\'s say I have two databases \'db1\' & \'db2\' on different mysql servers \'A\' & \'B\' respectively.

I want to check every 6 hours if there is any update fou

2条回答
  •  长情又很酷
    2021-01-23 13:36

    You could do with with a cron job, simply could run a php file every minute.

    this file can check for a new row in a table1 in db2 (saving current count of rows in a text file for comparison, and if new count > old count, then this can then update table1 in db1.

    easy

    but mysql replication as @Charles said in the comment would be better.

提交回复
热议问题