zoukankan      html  css  js  c++  java
  • mysql在不开启binlog的情况下导出数据库

    问题背景

    上个DBA已经走了,一些mysql数据库连所在服务器的系统账户也没有,只有mysql 数据库的root账户和业务账户,准备导出数据迁移至新服务器,可是mysqldump命令却是必须开启binlog日志才能导出,而binlog日志的开启依赖于配置文件log-bin参数,需要登录服务器修改配置文件并重启数据库才行。

    mysqldump -h172.20.17.95 -uroot -pReapal@2017 --set-gtid-purged=OFF --lock-tables --add-drop-table -E --flush-logs --triggers --routines --events --master-data=2 testdb > test_20171206.sql
    mysqldump: [Warning] Using a password on the command line interface can be insecure.
    mysqldump: Error: Binlogging on server not active

    解决方案

    mysql5.7之后推出了mysqlpump命令,相比mysqldump,它可以在不开启binlog的情况下备份数据,另外该命令还支持排除数据库或表进行备份
    mysqlpump -h172.20.17.95 -uroot -pReapal@2017 --set-gtid-purged=OFF --single-transaction --add-drop-table --triggers --routines --events -B testdb> testdb_20171206.sql

    -B, --databases Dump several databases. Note the difference in usage; in
    this case no tables are given. All name arguments are
    regarded as database names. 'USE db_name;' will be
    included in the output.

  • 相关阅读:
    Windows phone开发 网络编程之HttpWebRequest
    ASP.NET AJAX应用
    Web程序安全机制
    SQLCE本地数据库
    Web服务
    LINQ数据库技术
    windows phone媒体应用开发
    ASP.NET文件操作
    ASP.NET XML文件
    centos6.5安装配置fastdfs+nginx实现分布式图片服务器
  • 原文地址:https://www.cnblogs.com/automng/p/7992526.html
Copyright © 2011-2022 走看看