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. Let's Chat ZOJ - 3961

    ACM (ACMers' Chatting Messenger) is a famous instant messaging software developed by Marjar Technolo ...

  2. echo 换行与否

    echo默认是有换行的, -n的时候, 是不换行的.

  3. Android Camera2 参数调节关键字翻译集合,常用关键字解析

    https://blog.csdn.net/qq_29333911/article/details/79400617 black_level_lock黑电平补偿是否锁定当前值,或者可以自由更改.col ...

  4. django创建app、在视图函数及url中使用参数、url命名、通过redirect实现网页路径跳转

    app用来实现一个独立的功能,视图一般都写在app的view.py中,并且视图的第一个参数永远是request,视图的返回值必须是HttpResponseBase对象或子类的对象. 创建一个app:f ...

  5. P2709 小B的询问(莫队)

    P2709 小B的询问 莫队模板 资磁离线询问 维护两个跳来跳去的指针 先分块,蓝后询问按块排序. 蓝后每次指针左右横跳更新答案 #include<iostream> #include&l ...

  6. Web视频播放之video.js

    h5这么火是有它的理由的,支持原生视频播放,但是目前兼容性还不是很好,因此使用js框架支持网站视频播放是比较不错的选择. 下载video.js,我们可以通过官网去下,但是官网在国外,我尝试了几次均下载 ...

  7. 深入浅出TCP之半关闭与CLOSE_WAIT

    转自:https://www.2cto.com/net/201309/243585.html(相关链接) 深入浅出TCP之半关闭与CLOSE_WAIT 终止一个连接要经过4次握手.这由TCP的半关闭( ...

  8. mongodb安装、远程访问设置、基本常用操作和命令以及GUI

    https://www.mongodb.com/download-center?jmp=nav下载对应OS的版本,tar -xzvf解压 对于最新版本比如3.4,windows 7下可能回报api-m ...

  9. dubbo-启动时检查

    dubbo缺醒会在启动时检查依赖的服务是否可用,不可用时会抛出异常,阻止Spring初始化完成,以便上线时,能及早发现问题,默认 check=true 可以通过 check=false 关闭检查,比如 ...

  10. Android4.0以上版本Http请求的问题

    异常:android.os.NetworkOnMainThreadException Android 4.1项目:使用新浪微博分享时报: android.os.NetworkOnMainThreadE ...