mysql: "Warning: Using a password on the command line interface can be insecure." 解决方法
错误重现:
命令行或者shell脚本中执行以下命令,如果您当前服务器mysql版本是大于5.6的,则会出现警告:Warning: Using a password on the command line interface can be insecure. 这是mysql避免明文密码出现在脚本中做的安全提升
mysqldump -h$ -u$ -p$ -P3306 -B ${dbnames} --single-transaction --triggers --routines --events --master-data= -F | gzip > $data_dir/$1_`date +%Y%m%d`.sql.gz
警告信息看着不爽,特别是crontab定时执行shell时,邮件会收到“原本该忽视”的stderr标准错误。
解决方案:
这里只说一个,利用 mysql_config_editor 进行预先设置连接信息,具体做法如下:
1、设置登录信息
mysql_config_editor set --login-path=mall --host=mall.palcent.com --user=dumper -p
设置完毕,会在用户主目录%home%下生成一个.mylogin.cnf 文件,比如root用户,则生成 /root/.mylogin.cnf 。
2、查看当前主机上的加密文件
mysql_config_editor print --all
3、使用加密文件
登录Mysql
mysql --login-path=mall
# Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is
备份数据库
mysqldump --login-path=mall --databases ${dbnames} --single-transaction --triggers --routines --events --master-data= -F | gzip > $data_dir/$1_`date +%Y%m%d`.sql.gz
当然还有其他解决方案, 请自行参考以下参考链接!
参考链接:
https://www.cnblogs.com/rockbes/p/3972763.html (mysql_config_editor 用法)
https://blog.csdn.net/zxssoft/article/details/89667874
https://dev.mysql.com/doc/refman/8.0/en/password-security-user.html (官方解决方案)
mysql: "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.解决办法
转自 http://www.cnblogs.com/sunss/p/6256706.html 被一个小朋友问到,直接公布答案: If your MySQL client/server version ...
- zabbix 3.4监控mysql,提示mysql: [Warning] Using a password on the command line interface can be insecure.
mysql从5.6版本开始,如果是命令行直接出现了数据库连接密码就会有以下警告: mysql: [Warning] Using a password on the command line inter ...
- Mysql: [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 5.6 警告信息 comma ...
- mysql: [Warning] Using a password on the command line interface can be insecure. ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
错误情况 解决办法: 首先查看mysql的命令 其次修改root用户的密码 set password for 'root'@'localhost' = password('123456'); 最后退出 ...
- Warning: Using a password on the command line interface can be insecure.解决办法
被一个小朋友问到,直接公布答案: If your MySQL client/server version is a 5.6.x a way to avoid the WARNING message a ...
- MYSQL报警:Warning: Using a password on the command line interface can be insecure.
问题描述:执行下面的语句,sql是执行成功了,但是出现了一个报警,报警看上去始终不舒服 mysql -hip -Pport -uuser -ppassword -e "use db;dele ...
- 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" 登陆 ...
- 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 备份报错mysqldump: [Warning] Using a password on the command line interface can be insecure.
-------------------------------------------------------------------------------- mysql 备份报错mysqldump ...
随机推荐
- 查询sql server占用内存的情况
se master go select * from sysperfinfo where counter_name like '%Total Server Memory (KB)%' go
- 2014-03-01 春季PAT 1073-1076解题报告
今天下午的PAT考试状态不理想,回来怒刷了一遍,解题报告如下: 1073. Scientific Notation (20) 基本模拟题,将一长串的科学计数转换为普通的数字表示方式.思路是是数组存储输 ...
- python3.7爬取墨菲定律保存在本地txt
#!/usr/local/bin/python3.7 # -*- coding: utf-8 -*- # @Time: 2019/07/15 # @Function 获取在线文本内容 import r ...
- css 块级格式化上下文(BFC)
一.块级格式化上下文(BFC) 1.什么是块级格式化上下文? Block Formatting Contexts (BFC,块级格式化上下文)就是一个块级元素 的渲染显示规则 (可以把 BFC 理解为 ...
- ES集群health为yellow解决办法
原创转载请注明出处:https://www.cnblogs.com/agilestyle/p/11766147.html Logstash导入数据后,Cerebro显示集群health的状态为yell ...
- 【HbuilerX-Bug】终端无法显示打印信息,也无法输入
经过调试HbuilderX“终端”插件,最终定位问题,问题是插件在打开终端时,无法定位具体的窗口程序,如“cmd.exe”.“powershell.exe”等.可能产生原因:1.可能是电脑系统升级产生 ...
- [洛谷P3145] CQOI2009 循环赛
问题描述 n队伍比赛,每两支队伍比赛一次,平1胜3负0. 给出队伍的最终得分,求多少种可能的分数表. 输入格式 第一行包含一个正整数n,队伍的个数.第二行包含n个非负整数,即每支队伍的得分. 输出格式 ...
- 对排序(Sort)的研究
这一篇主要是介绍一些数据排序的基本算法和高级算法并利用JavaScript来逐一实现, 算法的说明: 稳定:如果a原本在b前面,当a=b时,排序之后a仍然在b的前面 不稳定:如果a原本在b的前面,当a ...
- Windows系统安装教程
身边很多朋友电脑系统因为这样那样的问题不能开机,需要重装系统,但是又不知道从何下手.很不建议去电脑店重装系统,因为电脑店用的操作系统很多都有捆绑软件和主页捆绑,对电脑体验影响很坏.这篇教程只是针对新手 ...
- Springboot ,1开启配置与2.扫描包(控制层,service层)二个注解@EnableAutoConfiguration,@ComponentScan 合并成一个注解@SpringBootApplication
//@EnableAutoConfiguration//@ComponentScan(value= {"com.foen.cloud.controller.*","com ...