首页 > 代码库 > Mysqldump 常用备份操作命令

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=http://www.mamicode.com/2–single-transaction –routines –triggers –events mc_orderdb >mc_orderdb.sql 备份一个库

mysqldump –ubackup –p –master-data=http://www.mamicode.com/2–single-transaction –routines –triggers –events mc_orderdb table_nametable_name…> xxx.sql 备份表

mysqldump –ubackup –p –master-data=http://www.mamicode.com/1 –single-transaction –routines –triggers–events –all-databases > db.sql 备份整个实例

mysqldump –ubackup –p –master-data=http://www.mamicode.com/2–single-transaction –routines –triggers –events –tab=’/xx/xxx’ mc_orderdb >xxx.sql 分表结构和数据分开备份

mysql需对/xx/xxx可写权限

mysqldump –ubackup –p –master-data=http://www.mamicode.com/2–single-transaction –where=”order_id> 1000 and order_id <1050” mc_orderdbtable_name > xxx.sql where条件的单表备份


Mysqldump 常用备份操作命令