数据库备份出现警告: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.先来看原备份数据库语句:
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的更多相关文章
- Centos下_MysqL5.7在使用mysqldump命令备份数据库报错:mysqldump: [Warning] Using a password on the command line interface can be insecure.
在阿里云服务器增加一个shell脚本定时备份数据库脚本执行任务时,测试性的执行了备份命令,如下 [root@iZ2ze503xw2q1fftv5rhboZ mysql_bak]# /usr/local ...
- MysqL5.7在使用mysqldump命令备份数据库报错:mysqldump: [Warning] Using a password on the command line interface can be insecure.
在阿里云服务器增加一个shell脚本定时备份数据库脚本执行任务时,测试性的执行了备份命令,如下 [root@iZ2ze503xw2q1fftv5rhboZ mysql_bak]# /usr/local ...
- 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 ...
- mysql 备份报错mysqldump: [Warning] Using a password on the command line interface can be insecure.
-------------------------------------------------------------------------------- mysql 备份报错mysqldump ...
- 【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.”在命令行使用密码不安全警 ...
- 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 ...
- 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 ...
- 解决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 ...
- 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 ...
随机推荐
- 使用Wisdom RESTClient如何在Linux和Mac上获取测试报告和API文档?
使用Wisdom RESTClient自动化测试REST API,生成REST API文档, 需要先执行命令java -jar restclient-1.2.jar启动Wisdom RESTClien ...
- PHP5.4以下的json_encode中文被转码的问题
PHP的json_encode中文被转码的问题 在php5.2中做json_encode的时候.中文会被unicode编码, php5.3加入了options参数, 5.4以后才加入JSON_UN ...
- Docker学习笔记之常见 Dockerfile 使用技巧
0x00 概述 在掌握 Dockerfile 的基本使用方法后,我们再来了解一些在开发中使用 Dockerfile 的技巧.这一小节的展现方式与之前的略有不同,其主要来自阅读收集和我自身在使用中的最佳 ...
- oracle查询所有初始化参数(含隐含参数)
年龄大了,感觉记性不是很好了,还是重新做笔记了.最近在整理些稿子,顺便在记录下oracle查询所有初始化参数(含隐含参数): SELECT i.ksppinm name, i.ksppdesc des ...
- mysql 8.0 Druid连接时调用getServerCharset报空指针异常解决方法
类似错误信息如下: 16:52:01.163 [Druid-ConnectionPool-Create-1641320886] ERROR com.alibaba.druid.pool.DruidDa ...
- Oracle redo/undo 原理理解
一. 什么是redo(用于重做数据) redo也就是重做日志文件(redo log file),Oracle维护着两类重做日志文件:在线(online)重做日志文件和归档(archived)重做日志文 ...
- javascript 点击按钮实现隐藏显示切换效果
原文链接:http://www.jb51.net/article/79083.htm <html> <head> <meta charset="gb2312&q ...
- 20155201 网络攻防技术 实验九 Web安全基础
20155201 网络攻防技术 实验九 Web安全基础 一.实践内容 本实践的目标理解常用网络攻击技术的基本原理.Webgoat实践下相关实验. 二.报告内容: 1. 基础问题回答 1)SQL注入攻击 ...
- 18种CSS3loading效果完整版
今天把之前分享的两篇博客<CSS3实现10种Loading效果>和 <CSS3实现8种Loading效果[二]>整理了一下.因为之前所分享的各种loading效果都只是做了we ...
- python --- 25 模块和包
一.模块 1.导入方式 自己创建的模块名称 切不可和 内置模块的一样 ① import 模块 ② import 模块 as 名 设置在此空间的名称 ③ from 模块 import ...