1.先来看原备份数据库语句:

 mysqldump -h 127.0.0.1 -uroot -ppassword database > /usr/microStorage/dbbackup/capsule_prod$(date +%Y%m%d_%H%M%S).sql

警告信息1:

Warning: Using a password on the command line interface can be insecure.

意思是说:在命令行界面上使用密码可能是不安全的,不能直接把密码写在脚本中。

解决方法:

在/etc/my.cnf中配置用户名与密码

 [client]
port = 3306
socket = /tmp/mysql.sock
default-character-set = utf8mb4
host = localhost        //地址
user = root           //用户
password = 'myServerPwd'    //密码

现在备份数据库语句为:

 mysqldump --defaults-extra-file=/etc/my.cnf database > /usr/microStorage/dbbackup/capsule_prod$(date +%Y%m%d_%H%M%S).sql

目前第一个警告解决。

警告信息2:

Warning: A partial dump from a server that has GTIDs will by default include the GTIDs of all transactions, even those that changed suppressed parts of the database. If you don't want to restore GTIDs, pass --set-gtid-purged=OFF. To make a complete dump, pass --all-databases --triggers --routines --events.

关于GTID是5.6以后,加入了全局事务 ID (GTID) 来强化数据库的主备一致性,故障恢复,以及容错能力。
官方给的:A global transaction identifier (GTID) is a unique identifier created and associated with each transaction committed on the server of origin (master).

解决方法:

在上面的脚本中加入 --set-gtid-purged=off 或者–gtid-mode=OFF这两个参数设置

现在备份数据库语句为:

 mysqldump --defaults-extra-file=/etc/my.cnf --set-gtid-purged=off microstorage_backend > /usr/microStorage/dbbackup/capsule_prod$(date +%Y%m%d_%H%M%S).sql

以上两个警告解决。

最新文章

  1. HTML中的title换行问题
  2. Oracle外键不加索引会引起死锁问题
  3. MVC4之ModelBinder-模型绑定
  4. [XAF]如何在非按钮事件中打开视图
  5. Balanced Lineup(最简单的线段树题目)
  6. Ajax学习之小结
  7. Mybatis拦截器实现分页
  8. 解决:启用多线程调用webBrowsers函数报错:指定的转换无效
  9. Docker 网络设置
  10. c++函数参数类型-引用、指针、值
  11. BZOJ5091: [Lydsy1711月赛]摘苹果【期望DP】
  12. C# 关于out和ref的问题
  13. SpringBoot application.yml文件不生效
  14. c# 通过html导出pdf,带分页
  15. BZOJ 2745: [HEOI2012]Bridge
  16. EXCEPTION-STRUTS2
  17. php 用户向微信发送信息
  18. 解决用户自生成meta导入kylin后报错问题Can not deserialize instance of java.lang.String[] out of VALUE_STRING token
  19. mysql数据库迁移到oracle数据库后 如何删除相同的数据
  20. Python将一个大文件按段落分隔为多个小文件的简单方法

热门文章

  1. Andriod post Api与返回值
  2. be动词
  3. c语言cgi笔记
  4. 关于er模型中的identifying relationship or non-identifying relationship
  5. 【题解】Luogu P4679 [ZJOI2011]道馆之战
  6. git 随笔
  7. linux下网卡bonding配置(转)
  8. 复旦大学2016--2017学年第二学期高等代数II期末考试情况分析
  9. 最最简单的c语言函数汇编分析
  10. 【示例】Spring Quartz入门