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 ...
随机推荐
- python安装BeautifulSoup
1.先下载pip https://pypi.python.org/pypi/pip 安装pip cd到路径 python setuo.py install 2.添加目录到环境变量中 xxx\Pytho ...
- Node.js+MySQL管理工作的详细信息所遇到的问题
问题陈述: Error: ER_TRUNCATED_WRONG_VALUE_FOR_FIELD: Incorrect string value: '\xE8\xB4\xAD\xE7\x89\xA9' ...
- Jquery 一次处理多个ajax请求的代码
Jquery 一次处理多个ajax请求的代码,需要的朋友可以参考下. 复制代码代码如下: $(document).ready(function () { $('#getsetgo').click( ...
- Ubuntu下,清屏等终端常用命令
转自:http://blog.csdn.net/gaojinshan/article/details/9314435 # ctrl + l - 清屏 . cLear# ctrl + c - 终止命令. ...
- C,C++开源项目中的100个Bugs
俄罗斯OOO Program Verification Systems公司用自己的静态源码分析产品PVS-Studio对一些知名的C/C++开源项目,诸如Apache Http Server.Chro ...
- postgres10配置huge_pages
操作系统 修改/boot/grub2/grub.cfg 定位到第一个'menuentry 'CentOS Linux',在"linux16 /vmlinuz"最后面添加 numa= ...
- iOS:iOS开发系列–打造自己的“美图秀秀”(中)
来源: KenshinCui 链接:http://www.cnblogs.com/kenshincui/p/3959951.html 其他状态设置 常用的图形上下文状态设置上面基本都用到了,我们不再一 ...
- (转)IntelliJ Idea 常用快捷键列表 for win
Ctrl+Shift + Enter,语句完成 ctrl+alt+左键 进入实现方法 “!”,否定完成,输入表达式时按 “!”键Ctrl+E,最近的文件Ctrl+Shift+E,最近更改的文件Shif ...
- linux 设置 亮度
调整系统运行的配置文件位于 /sys/class/ 文件夹下. 调整亮度在 /sys/class/backlight/XXXX/brightness XXXX 是因为使用的驱动不一样,名称就会不一样, ...
- Maven中setting.xml配置Demo
<!-- 指定本地默认仓库 --> <localRepository>G:\Java\apache-maven-3.5.2\repository</localReposi ...