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 ...
随机推荐
- 使用GDB调试将符号表与程序分离后的可执行文件
环境: Centos7.3.GCC4.8.5 适用场景: 由于调试信息比较大,通常将程序分离为可执行程序和符号信息文件,只对外发布可执行程序,需要调试时再将符号信息文件附加. 一.创建可执行程序: u ...
- TensorFlow机器学习实战指南之第二章
一.计算图中的操作 在这个例子中,我们将结合前面所学的知识,传入一个列表到计算图中的操作,并打印返回值: 声明张量和占位符.这里,创建一个numpy数组,传入计算图操作: import tensorf ...
- HISI VENC 实际输出帧率控制
https://blog.csdn.net/spy_007_/article/details/83688287 平台:HI3516EV100 SDK : Hi3516CV300_SDK_V1.0.2. ...
- supervisor 文档
supervisor 是用 Python 开发的一个 C/S 服务.是 Linux/Unix 系统下的进程管理工具.它可以很方便的监听.启动.停止.重启一个或多个进程.用Supervisor管理的进程 ...
- 详解java定时任务---Timer篇
一.简介 在java的jdk中提供了Timer.TimerTask两个类来做定时任务. Timer是一种定时器工具,用来在一个后台线程计划执行指定任务,而TimerTask一个抽象类,它的子 ...
- linux 线程同步
参考链接:https://blog.csdn.net/daaikuaichuan/article/details/82950711#font_size5font_2 一,互斥锁 #include &l ...
- react连连看
// Math.floor(t * Math.random()); var isInclude = function (array, element) { let alen = array.len ...
- Tomcat应用部署
1.Tomcat安装配置 1.1安装包下载 http://tomcat.apache.org/ 选择下载安装包版本 选择适合当前系统的安装包 安装包目录说明: 1.2环境配置 配置用户名密码conf/ ...
- 搭建vsftpd服务
配置文件 anonymous_enable=NOlocal_enable=YESwrite_enable=YESlocal_umask=022dirmessage_enable=YESxferlog_ ...
- 了解unix操作系统发展阶段
UNIX操作系统简介 UNIX操作系统(尤尼斯),是一个强大的多用户.多任务操作系统,支持多种处理器架构,按照操作系统的分类,属于分时操作系统,最早由KenThompson.Dennis Ritchi ...