1.全备
mysqldump -u root -padmin --single-transaction --events --triggers --routines --all-databases > all-databases-`date +%F`.sql
2.全备还原
source all-databases-`date +%F`.sql
3.分库备
mysqldump -u root -padmin --single-transaction --events --triggers --routines --databases test > test-database-`date +%F`
4.分库还原
source test-database-`date +%F`.sql
5.分表备
mysqldump -u root -padmin --single-transaction --events --triggers --routines test a > test-a-`date +%F`.sql
6.分表还原
source test-a-`date +%F`.sql
本文出自 “不进则退” 博客,请务必保留此出处http://merrycheng.blog.51cto.com/5331300/1688499
原文地址:http://merrycheng.blog.51cto.com/5331300/1688499