/usr/local/mysql/bin/mysqldump  --single-transaction --master-data=2 -A --flush-logs | gzip > /data/PRS-DB-01_all.sql.gz大家看看上面这句话,帮忙详细解释下,主要是--master-data=2 -A --flush-logs 这个参数,谢谢大家

解决方案 »

  1.   

    ·         --master-data[=value]该选项将二进制日志的位置和文件名写入到输出中。该选项要求有RELOAD权限,并且必须启用二进制日志。如果该选项值等于1,位置和文件名被写入CHANGE MASTER语句形式的转储输出,如果你使用该SQL转储主服务器以设置从服务器,从服务器从主服务器二进制日志的正确位置开始。如果选项值等于2,CHANGE MASTER语句被写成SQL注释。如果value被省略,这是默认动作。
    ·         --all--database,-A转储所有数据库中的所有表。与使用---database选项相同,在命令行中命名所有数据库
             --flush-logs,-F开始转储前刷新MySQL服务器日志文件。该选项要求RELOAD权限。请注意如果结合--all--database(或-A)选项使用该选项,根据每个转储的数据库刷新日志。例外情况是当使用--lock-all-tables或--master-data的时候:在这种情况下,日志只刷新一次,在所有 表被锁定后刷新。如果你想要同时转储和刷新日志,应使用--flush-logs连同--lock-all-tables或--master-data。
      

  2.   

    --master-data[=#]   This causes the binary log position and filename to be
                          appended to the output. If equal to 1, will print it as a
                          CHANGE MASTER command; if equal to 2, that command will
                          be prefixed with a comment symbol. This option will turn
                          --lock-all-tables on, unless --single-transaction is
                          specified too (in which case a global read lock is only
                          taken a short time at the beginning of the dump - don't
                          forget to read about --single-transaction below). In all
                          cases any action on logs will happen at the exact moment
                          of the dump.Option automatically turns --lock-tables off. -F, --flush-logs    Flush logs file in server before starting dump. Note that
                          if you dump many databases at once (using the option
                          --databases= or --all-databases), the logs will be
                          flushed for each database dumped. The exception is when
                          using --lock-all-tables or --master-data: in this case
                          the logs will be flushed only once, corresponding to the
                          moment all tables are locked. So if you want your dump
                          and the log flush to happen at the same exact moment you
                          should use --lock-all-tables or --master-data with
                          --flush-logs
      

  3.   

    知道了,谢谢您,再问下,这个工具支持在线备份吗?如果支持,那个是myISAM引擎吗?