I have a large MySQL database, lets call it live_db, which I want to replicate on the same machine to provide a test system to play around with (test_db), including table structure and data.
In regular intervals I want to update the test_db with the content of the live_db; if possible incremental.
Is there some built-in mechanism in MySQL to do that? I think that master-slave replication is not the thing I want since it should be possible to alter data in the test_db. These changes do not have to be preserved, though.
Regards,
CGD
The
mysqlcommand line client will accept a stream of SQL statements from standard input. You can therefore pipe the output ofmysqldumpdirectly intomysqlon the command line. Doing this as a cron job will regularly overwrite your test data with updated live data:Note that since your data is large, it will take a long time.