Mysql – database development environment, MySql

database-designMySQLreplication

I need to create copy/replication of our databases for the development environment.

I'm not sure how to do it. DBs are updating many times during a day; not only new records added but also old records are updated.

How should I implement it?

Best Answer

The "right answer" is highly application dependant, but here are a few strategies I've seen used before.

Daily Backup / Restore-on-demand

This works well if you have a small data set, and the need to be able to have various developers use the backups ad-hoc. The idea is basically a mysqldump on a replication target system and some scripts to do a MySQL import.

Binary Log Replication

This method probably won't work for you, as you specifically want to read and write to the development database. Sometimes people will use replication to run read-only regression testing against, but modifying the database will result in failed replication and/or inconsistent data.

[https://serverfault.com/questions/380701/replicate-main-mysql-db-to-a-development-server-to-play-with-real-data]