MysqL5.7在使用mysqldump命令备份数据库报错:mysqldump: [Warning] Using a password on the command line interface can be insecure.
在阿里云服务器增加一个shell脚本定时备份数据库脚本执行任务时,测试性的执行了备份命令,如下
[root@iZ2ze503xw2q1fftv5rhboZ mysql_bak]# /usr/local/mysql/bin/mysqldump -uroot -pmyServerPwd# dateabase > /data/mysql_bak/bak_test.sql
在执行完了命令本该在指定的目录下出现bak_test.sql文件,然而并没有生成,报了一行错误。这个问题应该是在MySQL5.6+版本的时候就有出现,可能是为了确保数据库的安全性采用的保护机制。
mysqldump: [Warning] Using a password on the command line interface can be insecure.
网上大部分给出的解决方案都是修改mysql的配置文件,给[client]选项增加三行命令
vim /etc/my.cnf
[client]
port =
socket = /tmp/mysql.sock
default-character-set = utf8mb4
host = localhost //地址
user = root //用户
password = 'myServerPwd' //密码
记得去掉注释
在增加了三行代码,我习惯性的重启了mysql服务,再同样执行备份命令,发现还是出现错误。
在搜索各种方案的过程中也无意中发现关于此方法在安全性上的一些官方性不足,mysql的官方给出的说明。
https://dev.mysql.com/doc/refman/5.6/en/password-security-user.html?spm=5176.7737807.2.3.D6p7hh
然后针对高版本Mysql备份数据库的解决方案来了,前方高能~~~
命令和以前常用的快速导入和导入命令有所不同了,需要加载我们配置的MYSQL配置文件!
/usr/local/mysql/bin/mysqldump --defaults-extra-file=/etc/my.cnf database > /data/mysql_bak/bak_test.sql //备份导出数据库
/usr/local/mysql/bin/mysql --defaults-extra-file=/etc/my.cnf database < test_db.sql //导入数据库
查看/data/mysql_bak下,发现想要的数据库备份文件出现了~
MysqL5.7在使用mysqldump命令备份数据库报错:mysqldump: [Warning] Using a password on the command line interface can be insecure.的更多相关文章
- Centos下_MysqL5.7在使用mysqldump命令备份数据库报错:mysqldump: [Warning] Using a password on the command line interface can be insecure.
在阿里云服务器增加一个shell脚本定时备份数据库脚本执行任务时,测试性的执行了备份命令,如下 [root@iZ2ze503xw2q1fftv5rhboZ mysql_bak]# /usr/local ...
- 数据库备份出现警告: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/cap ...
- 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."提示信息
在对mysql进行完整备份时使用--all-database参数 # mysqldump -u root -h localhost -p --all-database > /root/all.s ...
- 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 ...
- MYSQL5.7脚本运行时出现[Warning] Using a password on the command line interface can be insecure
MYSQL版本:5.7 在写linux脚本执行MYSQL命令的时候,如果使用 MYSQL="mysql -hlocalhost -P3306 -uroot -p666666" 登陆 ...
- Centos下_MysqL5.7在使用mysqldump命令备份数据库报错:mysqldump: Got error: 1449: The user specified as a definer ('fk_system'@'localhost') does not exist when using LOCK TABLES
在阿里云服务器增加一个shell脚本定时备份数据库脚本执行任务时,测试性的执行了备份命令,如下 [root@iZ2ze503xw2q1fftv5rhboZ mysql_bak]# /usr/local ...
- mysql在Windows下使用mysqldump命令备份数据库
在cmd窗口中使用mysqldump命令首先需要配置环境变量 1,在计算机中找到MySQL的安装位置,找到MySQL Workbench,比如我的是C:\Program Files\MySQL\MyS ...
随机推荐
- spring框架的总结
http://www.cnblogs.com/wangzn/p/6138062.html 大家好,相信Java高级工程师对spring框架都很了解吧!那么我以个人的观点总结一下spring,希望大家有 ...
- Caused by: java.io.FileNotFoundException: Could not open ServletContext resource [/WEB-INF/dispatcher-servlet.xml]
这是因为我把 [/WEB-INF/dispatcher-servlet.xml]的位置换成了[config/springmvc/dispatcher-servlet.xml] 因此idea在原来的位置 ...
- 解决IIS7多域名绑定同一物理目录,设置不同的默认文档的问题
IIS7多域名绑定同一物理目录,设置不同的默认文档是没办法设置的,因为在一个物理目录下只有一个web.config,并且IIS7把默认文档设置写在这里,导致所有域名的默认文档设置共享.解决方法:1.进 ...
- 阿里短信接口使用(JAVA版)
近期项目需要使用短信接口,对比下选择了阿里的短信接口 以下为开发笔记: maven pom.xml中引入: <dependency> <groupId>com.aliyun&l ...
- ios 自定义RadioButton
1 前言 众所周知在IOS中没有单选按钮这一控件,今天我们来学习一下简单的单选控件.类似与Web中的radio表单元素. 2 详述 本控件单纯的利用按钮控件和NSObject的respondsToSe ...
- EditorConfig文件
EditorConfig .editorconfig文件 在很多开源项目中,会出现这个文件,这个文件有何作用? editorconfig 帮助开发者的(编辑器和IDEs)定义和维护编程风格. 有些编辑 ...
- XAMPP虚拟主机配置--20150423
你需要一些顶级域名访问方式来访问你本地的项目文件而不是目录方式访问,这时候就需要配置虚拟主机,给你的目录绑定一个域名(本地的话可以通过修改 hosts 文件随便绑定什么域名比如 www.a.com 或 ...
- node爬虫(简版)
做node爬虫,首先像如何的去做这个爬虫,首先先想下思路,我这里要爬取一个页面的数据,要调取网页的数据,转换成页面格式(html+div)格式,然后提取里面独特的属性值,再把你提取的值,传送给你的页面 ...
- Vue开发微信公众号默认背景为灰色
最近公司有一个项目,使用Vue开发微信公众号,开发过程遇到一个问题,即设计图的整体背景是白色的,但是公众号里默认的背景是浅灰色,如果某个页面高度没能占满一屏,就会露出浅灰色的默认背景,会显得很不协调. ...
- Ubuntu 下的aegisub安装
大家用开源的软件用习惯了.推荐大家使用一下字幕编辑软件 分享的是Ubuntu下的安装教程: $ sudo add-apt-repository ppa:djcj/aegisub $ sudo apt- ...