Effectively clone MySQL database on another server

We need to regularly create a clone of the production server in real time in the MySQL 4 database (only one scheme) and import it into one or more development databases. Our current process is the "mysqldump" database, copy it via ssh and restore it to the target machine using the mysql client utility.

Dumping and copying is relatively fast, but restoring a database schema (structure + content) takes several hours. Is there less time for cloning?

+3
source share
3 answers

Use upload data infile . This is an order of magnitude faster than loading from landfills. If you're lucky, you can upload data using the feed. If you could export data from one server to the same channel, you could work with two servers at the same time.

+2
source

If you have LVM installed, look at using LVM to backup mysql . Using LVM, backups can be done very quickly. After the backup is downloaded tar and copy the snapshot to the destination and unlock it. It should be faster than loading from mysqldump.

+2
source

- mysqldump mysqldump , mysqlhotcopy , , cp/scp .

+1
source

Source: https://habr.com/ru/post/1729060/


All Articles