How can I slow down a MySQL dump as to not affect current load on the server?

前端 未结 6 1430
野性不改
野性不改 2020-11-30 18:11

While doing a MySQL dump is easy enough, I have a live dedicated MySQL server that I am wanting to setup replication on. To do this, I need dumps of the databases to import

6条回答
  •  孤独总比滥情好
    2020-11-30 18:32

    Use nice and gzip command to execute the command at lowest priority.

    nice -n 10 ionice -c2 -n 7 mysqldump db-name | gzip > db-name.sql.gz 
    

提交回复
热议问题