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"
登陆并执行sql语句的时候,每次连接都会出现
mysql: [Warning] Using a password on the command line interface can be insecure.
很烦,不美观。于是开始找各种解决办法,无非是修改/etc/my.cnf文件,但是安装了mysql之后想执行这个脚本就得改文件那不更麻烦,更不美观。
解决方案:
在执行上述连接的时候:使用环境变量 MYSQL_PWD 快速登陆
MySQL优先会使用环境变量中的参数作为运行参数,所以必须使用export命令
export MYSQL_PWD=666666
那么在连接的时候就可以免密登陆,例如:
MYSQL="mysql -hlocalhost -P3306 -uroot"
连接测试,成功。没有告警提示,不用修改文件,完美。
MYSQL5.7脚本运行时出现[Warning] Using a password on the command line interface can be insecure的更多相关文章
- MysqL5.7在使用mysqldump命令备份数据库报错:mysqldump: [Warning] Using a password on the command line interface can be insecure.
在阿里云服务器增加一个shell脚本定时备份数据库脚本执行任务时,测试性的执行了备份命令,如下 [root@iZ2ze503xw2q1fftv5rhboZ mysql_bak]# /usr/local ...
- 【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 ...
- 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的提示
最近在部署Zabbix时需要用脚本取得一些MySQL的返回参数,需要是numberic格式的,但是调用脚本时总是输出这一句: Warning: Using a password on the comm ...
- 解决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 ...
- 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 ...
- Warning: Using a password on the command line interface can be insecure.
[root@qttc ~]# /usr/local/mysql/bin/mysqldump -uroot -proot db > bak.sqlWarning: Using a passwor ...
随机推荐
- remove-weknow-ac from mac chrome
refer:https://macreports.com/how-to-remove-weknow-ac-malware-macos/ 1-Remove the weknow.ac profile. ...
- C# partial 关健字说明
参考:http://blog.csdn.net/niemeiquan/article/details/7801803 1. 什么是局部类型? C# 2.0 引入了局部类型的概念.局部类型允许我们将一个 ...
- SoapUI接口测试-验签值处理-调用java的加密jar包
转载自:https://www.jianshu.com/p/7c672426a165 一. 背景: 调用接口时有个请求参数是对请求入参按一定规则进行加密生成的验签值,每次不同参数的请求生成唯一的验签值 ...
- Spring Boot - AMQP 消息中间件
Message Broker是一种消息验证.传输.路由的架构模式,其设计目标主要应用于下面这些场景: 消息路由到一个或多个目的地 消息转化为其他的表现方式 执行消息的聚集.消息的分解,并将结果发送到他 ...
- 使用透视表pivot_table
使用透视表pivot_table 功能:从一张大而全的表格中提取出我们需要的信息来分析 import pandas as pd unames = ['user_id', 'gender', 'age' ...
- 代理设计模式在auto_ptr及smart_ptr中的体现
下面这段代码是auto_ptr的实现: class Image { public: Image(string name): m_imageName(name) {} virtual ~Image() ...
- 纵观 jBPM:从 jBPM3 到 jBPM5 以及 Activiti5
https://www.infoq.cn/article/rh-jbpm5-activiti5# 对jBPM来说,今年最大的事件莫过于 jBPM 的创建者Tom Baeyens离开 JBoss 了.T ...
- ios开发的frame、物理屏幕尺寸和图片分辨率
型号 屏幕尺寸(inch) 逻辑分辨率(point) 缩放因子(scale factor) 物理分辨率(pixel) 像素密度(PPI) iPhone3GS 3.5 320 * 480 @1x 320 ...
- oracle死锁的处理办法
摘自:https://www.cnblogs.com/xuke/p/4053396.html http://blog.itpub.net/30036720/viewspace-2121034/ ora ...
- 洛谷P1038 神经网络(bfs,模拟,拓扑)
题目背景 人工神经网络(Artificial Neural NetworkArtificialNeuralNetwork)是一种新兴的具有自我学习能力的计算系统,在模式识别.函数逼近及贷款风险评估等诸 ...