-- for MyISAM
-- --flush-privileges:serail the user tables
-- --lock-all-tables:lock all tables
-- --hex-blob:if we have binary data we must use it.for example BINARY,VARBINARY,BLOB
mysqldump --user=root --all-databases --flush-privileges --lock-all-tables --master- data=1 --flush-logs --triggers --routines --events --hex-blob > $BACKUP_DIR/ full_dump_$BACKUP_TIMESTAMP.sql
-- for Innodb
-- --single-transactionb
-- --master-data:1-binlog file name and position be recorded,2-binlog file name and position be recorded but be commented.
mysqldump --user=root --all-databases --flush-privileges --single-transaction --master- data=1 --flush-logs --triggers --routines --events --hex-blob > $BACKUP_DIR/ full_dump_$BACKUP_TIMESTAMP.sql
--routines 导出存储过程以及自定义函数
--triggers 导出触发器
--events 导出事件
--force 忽略错误
--add-locks