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

以上两个警告解决。

数据库备份出现警告:Warning: Using a password on the command line interface can be insecure. Warning: A partial dump from a server that has GTIDs will by default include the GTIDs of all transactions, even thos的更多相关文章

  1. Centos下_MysqL5.7在使用mysqldump命令备份数据库报错:mysqldump: [Warning] Using a password on the command line interface can be insecure.

    在阿里云服务器增加一个shell脚本定时备份数据库脚本执行任务时,测试性的执行了备份命令,如下 [root@iZ2ze503xw2q1fftv5rhboZ mysql_bak]# /usr/local ...

  2. MysqL5.7在使用mysqldump命令备份数据库报错:mysqldump: [Warning] Using a password on the command line interface can be insecure.

    在阿里云服务器增加一个shell脚本定时备份数据库脚本执行任务时,测试性的执行了备份命令,如下 [root@iZ2ze503xw2q1fftv5rhboZ mysql_bak]# /usr/local ...

  3. mysql备份时过滤掉某些库 以及 去掉"Warning: Using a password on the command line interface can be insecure."提示信息

    在对mysql进行完整备份时使用--all-database参数 # mysqldump -u root -h localhost -p --all-database > /root/all.s ...

  4. mysql 备份报错mysqldump: [Warning] Using a password on the command line interface can be insecure.

    -------------------------------------------------------------------------------- mysql 备份报错mysqldump ...

  5. 【mysql报错】MySQL5.7.27报错“[Warning] Using a password on the command line interface can be insecure.”

    MySQL5.7.27报错“[Warning] Using a password on the command line interface can be insecure.”在命令行使用密码不安全警 ...

  6. mysql: "Warning: Using a password on the command line interface can be insecure." 解决方法

    错误重现: 命令行或者shell脚本中执行以下命令,如果您当前服务器mysql版本是大于5.6的,则会出现警告:Warning: Using a password on the command lin ...

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

    MySQL 5.6 在命令行输入密码,就会提示这些安全警告信息. Warning: Using a password on the command line interface can be inse ...

  8. 解决mysql连接输入密码提示Warning: Using a password on the command line interface can be insecure

    有时候客户端连接mysql需要指定密码时(如用zabbix监控mysql)5.6后数据库会给出个警告信息 mysql -uroot -pxxxx Warning: Using a password o ...

  9. mysqldump: [Warning] Using a password on the command line interface can be insecure.

    MySQL 5.6 警告信息 command line interface can be insecure 修复 在命令行输入密码,就会提示这些安全警告信息. Warning: Using a pas ...

随机推荐

  1. [转载]tnsnames.ora监听配置文件详解

    监听配置文件             为了使得外部进程 如 CAMS后台程序 能够访问 Oracle 数据库 必须配             置 Oracle 网络服务器环境 配置 Oracle 网络 ...

  2. Twemproxy和Redis性能压力测试

    性能测试 Redis自带了一个叫 redis-benchmark的工具来模拟N个客户端同时发出M个请求,(类似于Apache ab程序),你可以使用redis-benchmark -h来查看基准参数. ...

  3. hashcat使用命令简介

    1.指定HASH类型 在HashCat中--hash-type ?参数可以指定要破解的HASH类型,运行hashcat主程序加上--help参数,在* Generic hash types:中可以看到 ...

  4. P2233 [HNOI2002]公交车路线

    洛咕原题 dp->矩阵乘法 首先我们可以得出一个状态转移方程 f[i][j]=f[i-1][j-1]+f[i-1][j+1] 蓝后发现,我们可以把这转化为一个8*8的转移矩阵 然后跑一遍矩阵快速 ...

  5. ssh-keygen 命令

    功能 生成.管理和转换认证密钥,包括 RSA 和 DSA 两种密钥,密钥类型可以用 -t 选项指定.如果没有指定则默认生成用于SSH-2的RSA密钥,系统管理员还可以用它产生主机密钥. 通常,这个程序 ...

  6. VS 域名绑定IIs 调试

    一排致敬老师傅:https://www.cnblogs.com/woxpp/p/5805624.html 问题: 域名www.jinhuang.com,网站的ip地域跳转出问题,需要测试. ①修改Ho ...

  7. Linux CentOS 7的图形界面安装(GNOME、KDE等)

    转载于:https://jingyan.baidu.com/article/0964eca26fc3b38284f53642.html 今天为大家介绍一下CentOS 7的图像界面安装(虚拟机和硬盘安 ...

  8. topcoder srm 708 div1 -3

    1.定义一个字符串s,定义函数$f(s)=\sum_{i=1}^{i<|s|}[s_{i-1}\neq s_{i}]$,给定字符串$p,q$,定义函数$g(p,q)=\sum_{c='a'}^{ ...

  9. Spring Cloud 入门指南

    Spring Cloud 方志朋-史上最简单的 Spring Cloud 教程

  10. SHOI 2017 相逢是问候(扩展欧拉定理+线段树)

    题意 https://loj.ac/problem/2142 思路 一个数如果要作为指数,那么它不能直接对模数取模,这是常识: 诸如 \(c^{c^{c^{c..}}}\) 的函数递增飞快,不是高精度 ...