Mysqldump 常用备份操作命令
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Mysqldump 常用备份操作命令相关的知识,希望对你有一定的参考价值。
1.1.1 备份操作
create user ‘backup’@’localhost’ identifiedby ‘’;
grant select, reload, lock tables,replication client, show view, event, view, process on *.* to‘backup’@’localhost’;
mysqldump –ubackup –p –master-data=2–single-transaction –routines –triggers –events mc_orderdb >mc_orderdb.sql 备份一个库
mysqldump –ubackup –p –master-data=2–single-transaction –routines –triggers –events mc_orderdb table_nametable_name…> xxx.sql 备份表
mysqldump –ubackup –p –master-data=1 –single-transaction –routines –triggers–events –all-databases > db.sql 备份整个实例
mysqldump –ubackup –p –master-data=2–single-transaction –routines –triggers –events –tab=’/xx/xxx’ mc_orderdb >xxx.sql 分表结构和数据分开备份
mysql需对/xx/xxx可写权限
mysqldump –ubackup –p –master-data=2–single-transaction –where=”order_id> 1000 and order_id <1050” mc_orderdbtable_name > xxx.sql where条件的单表备份
以上是关于Mysqldump 常用备份操作命令的主要内容,如果未能解决你的问题,请参考以下文章