shell脚本中执行mysql 语句,去除warning using a password on the command line interface can be insecure信息
方法二:使用mysql参数的方法
mysql -u$user -p$pass -D $db -e "select host from user;"
当然,可以通过将传参的方式来传递 -e 后面的语句。
使用示例:
cat count_tb_post_fourhour.sh
#!/bin/bash count_tb_post_fourhour_keys=`/usr/bin/mysql -hrr-bp1************.mysql.rds.aliyuncs.com -uzh*****ng -p******** -D dee****hion -e "select count(1) from tb_post where created_at > date_sub(now(), interval 4 hour) and platformId = 1;" >& |grep -v "Warning: Using a password"|grep -v "count";` echo $count_tb_post_fourhour_keys [root@weifeng scripts]# sh count_tb_post_fourhour.sh
shell脚本中执行mysql 语句,去除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 insecure
MySQL 5.6 在命令行输入密码,就会提示这些安全警告信息. Warning: Using a password on the command line interface can be inse ...
- MYSQL报警:Warning: Using a password on the command line interface can be insecure.
问题描述:执行下面的语句,sql是执行成功了,但是出现了一个报警,报警看上去始终不舒服 mysql -hip -Pport -uuser -ppassword -e "use db;dele ...
- mysql处理警告 Warning: Using a password on the command line interface can be insecure.
vim /etc/mysql/my.cnf [mysqldump] user=user_name password=password 格式: [只用密码的命令] user=用户名 password=密 ...
- mysql 5.7 Warning: Using a password on the command line interface can be insecure. 解决方案
百度了好多,发现都是lunix环境下的,没有找到windows和OS 的,在lunix环境下的解决方案一般就是修改数据库配置文件 my.conf 在Windows 中是没有my.cnf 文件,而是叫做 ...
- 解决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 ...
- 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: "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报错】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: [Warning] Using a password on the command line interface can be insecure MySQL 5.6 警告信息 comma ...
随机推荐
- 20162304 实验二《Java面向对象程序设计》实验报告
20162304 实验二<Java面向对象程序设计>实验报告 实验内容 初步掌握单元测试和TDD 理解并掌握面向对象三要素:封装.继承.多态 初步掌握UML建模 熟悉S.O.L.I.D原则 ...
- 找出最小元素的下标 Exercise07_10
import java.util.Scanner; /** * @author 冰樱梦 * 时间:2018年下半年 * 题目:找出最小元素的下标 * */ public class Exercise0 ...
- Problem G: 十进制数转换为二进制数
#include<stdio.h> int main() { ]; while(scanf("%d",&n)!=EOF) { ; ) { a[i++]=n%; ...
- 大内密探HMM(转)
源地址:http://blog.csdn.net/ppn029012/article/details/8923501 1. 赌场风云(背景介绍) 最近一个赌场的老板发现生意不畅,于是派出手下去赌场张望 ...
- 使 PHP 写的网站看上去像 asp 页面
# 使 PHP 代码看上去像 asp 页面 更改Apache 的httpd.conf中AddType application/x-httpd-php .php .phtml改为 AddType app ...
- [转]currentStyle和getComputedStyle的兼容写法
currentStyle:获取计算后的样式,也叫当前样式.最终样式. 优点:可以获取元素的最终样式,包括浏览器的默认值,而不像style只能获取行间样式,所以更常用到. 注意:不能获取复合样式如bac ...
- 内核创建的用户进程printf不能输出一问的研究
转:http://www.360doc.com/content/09/0315/10/26398_2812414.shtml 一:前言上个星期同事无意间说起,在用核中创建的用户空间进程中,使用prin ...
- ATL7窗口类详细剖析
前言: ATL是微软继MFC之后提供的一套C++模板类库,小巧.精妙.效率极高.它的主要作用是为我们编写COM/DOM/COM+程序提供了丰富的支持.但是ATL只能写COM么?我以前只是MFC程序员的 ...
- 解决kylin报错:java.lang.IllegalStateException
一个kylin build job执行到第三步Extract Fact Table Distinct Columns时报错: 2017-05-24 20:04:07,930 ERROR [pool-9 ...
- [Android Pro] Property Animation
声明:下面的内容需要Android API level 11的支持 Property Animation是如何运作的 首先,来看一下两个不一样的Property Animation场景: 场景一(Li ...