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 ...
随机推荐
- C#如何调用以管理员身份运行的cmd命令提示符
windows自从vista.win7.win8/8.1以及win10以来,命令行提示符分为两种模式,一种是普通用户模式,一种的管理员模式,很多情况下,我们的程序需要在命令提示符(管理员身份)的状况下 ...
- 创建一个dynamics 365 CRM online plugin (九) - Context.Depth
让我们来看看官方文档是怎么讲的 https://docs.microsoft.com/en-us/previous-versions/dynamicscrm-2016/developers-guide ...
- 解决openstack实例主机名后缀问题
参考地址https://ask.openstack.org/en/question/26918/change-novalocal-suffix-in-hostname/ 问题现象 可以看到主机名的后缀 ...
- 如何安装私有 npm 包?
安装私有 npm 包的步骤: 先安装私有 npm 包:npm install <npm包名> --registry=<npm包源> 然后运行npm install安装公共 np ...
- python-变量、if else语句 、for循环、while循环(4月26号)
变量: 五.注意:python是可执行程序 在linux写python第一行必须写#!/usr/bin/env python(声明解释器在windows中写python第一行需要写# -*- codi ...
- 两台Linux服务器之间复制文件
一.scp 1.简介 scp是secure copy的简写,用于在Linux下进行远程拷贝文件的命令,和它类似的命令有cp,不过cp只是在本机进行拷贝不能跨服务器,而且scp传输是加密的 2.软件安装 ...
- HashTable & HashMap & ConcurrentHashMap 原理与区别
一.三者的区别 HashTable HashMap ConcurrentHashMap 底层数据结构 数组+链表 数组+链表 数组+链表 key可为空 否 是 否 value可为空 否 是 否 ...
- 去freessl.org申请免费ssl服务器证书
去freessl.org申请免费ssl服务器证书 来源: 本文链接 来自osnosn的博客 写于: 2019-03-30. 想搞个自签名证书,可以参考这篇: 用openssl为WEB服务器生成证书(自 ...
- Elasticsearch-6.7.0系列(三)5601端口 kibana——ES的UI界面
https://artifacts.elastic.co/downloads/kibana/kibana-6.7.0-linux-x86_64.tar.gz Kibana下载 有了elast ...
- CBSN NEWS
https://www.cbsnews.com/video/fatal-crossing/