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 ...
随机推荐
- [Codeforces 1053C] Putting Boxes Together
Link: Codeforces 1053C 传送门 Solution: 先推出一个结论: 最后必有一个点不动且其为权值上最中间的一个点 证明用反证证出如果不在中间的点必有一段能用代价少的替代多的 这 ...
- AGC 014 B - Unplanned Queries
题面在这里! 很显然的一件事是,我们把路径覆盖改成两个点分别到根的路径覆盖,答案是不会变的,因为lca以上被覆盖了两次不变奇偶性.. 这么做的好处就是,我们只需要考虑每个点的覆盖次数带来的影响就行了, ...
- HDU 6044 Limited Permutation(搜索+读入优化)
[题目链接] http://acm.hdu.edu.cn/showproblem.php?pid=6044 [题目大意] 给出两个序列li,ri,现在要求构造排列p,使得对于区间[li,ri]来说, ...
- 内网中让其他人访问我电脑上的asp.net应用程序
打开防火墙,高级配置,新建入站规则,选择“端口”,下一步,填写特定本地端口,然后都是点击下一步,命名规则,到此,内网中的其他人可以访问你的程序了
- Unity3D 避免玩家作弊
如果你的Unity项目快上线了,我强烈建议你看一下Anti-Cheat这个插件.因为IOS和Android分别越狱和Root后玩家可以使用 @八门神器 @烧饼修改器 等一些列作弊的软件来修改游戏内存, ...
- Bootstrap导航栏实例讲解
导航栏是一个很好的功能,是 Bootstrap 网站的一个突出特点.导航栏是响应式元组件就,作为应用程序或网站的导航标题.导航栏在移动设备的视图中是折叠的,随着可用视口宽度的增加,导航栏也会水平展开. ...
- mysql用法之创建事件
1.创建事件:每天凌晨两点自动删除de_records表中七天以前的数据 CREATE EVENT event_delete_de_records_7days ON SCHEDULE EVERY 1 ...
- 数组类型参数传递问题:$.ajax传递数组的traditional参数传递必须true
数组类型参数传递: 若一个请求中包含多个值,如:(test.action?tid=1&tid=2&tid=3),参数都是同一个,只是指定多个值,这样请求时后台会发生解析错误,应先使用 ...
- 深度增强学习--DQN的变形
DQN的变形 double DQN prioritised replay dueling DQN
- 获取web.py上面的示例code
import requests import re import os.path #取得文件名和内容对应字典 def getCode(url): pattern=re.compile(r'<h\ ...