zabbix监控mysql之Warning: Using a password on the command line interface can be insecure.
来源:互联网 发布:xquartz for mac 编辑:程序博客网 时间:2024/06/01 18:35
使用zabbix自带模板对mysql进行监控时,发现mysql5.6以上版本在使用mysqladmin时会发出警告:“Warning: Using a password on the command line interface can be insecure.” 。这样zabbix服务端获取数值的时候,会带有该字符串,导致报错。
解决办法试了很多,包括:
1、使用grep -v Warning result进行过滤。
2、使用mysql_config_editor进行无密码操作。
3、修改my.conf配置文件,将mysqladmin用户名密码写入配置文件。
4、在zabbix服务端寻找过滤返回值的操作。
但是以上方法都未凑效,很是尴尬。
最后实验成功的方法是:将mysqladmin的警告信息重定向到/dev/null,忽略掉告警信息。
Com_select)
result=`/usr/bin/mysqladmin -u$MYSQL_USER -h$MYSQL_HOST -p${MYSQL_PWD} -S $MYSQL_SOCK extended-status 2>/dev/null|grep -w "Com_select"|cut -d"|" -f3`
echo $result
;;
在原有命令中加上2>/dev/null 就行了。
使用服务端的zabbix_get命令测试下:
修改之前:
[root@VM-4ecd-7f03-4bf-9a bin]# ./zabbix_get -s xx.xx.xx.xx -p 10050 -k mysql.status[Uptime]
Warning: Using a password on the command line interface can be insecure.
159486
修改之后:
[root@VM-4ecd-7f03-4bf-9a bin]# ./zabbix_get -s xx.xx.xx.xx -p 10050 -k mysql.status[Uptime]
159496
mysql告警信息不见了。
另:有人告诉我可以通过“mysqladmin --defaults-extra-file=/etc/my.cnf”进行处理,因为问题已经解决了,就没有去尝试了。
- zabbix监控mysql之Warning: Using a password on the command line interface can be insecure.
- zabbix Warning: Using a password on the command line interface can be insecure
- Error: mysql error: mysql: [Warning] Using a password on the command line interface can be insecure
- Warning: Using a password on the command line interface can be insecure .ERROR 1045 (28000): Access
- cmd命令行下 Warning: Using a password on the command line interface can be insecure.
- Warning: Using a password on the command line interface can be insecure.
- mysqldump Warning: Using a password on the command line interface can be insecure.
- Warning: Using a password on the command line interface can be insecure
- mysql 备份报错mysqldump: [Warning] Using a password on the command line interface can be insecure.
- MySQL 解决数据导出问题:Using a password on the command line interface can be insecure.
- MySQL5.6 Using a password on the command line interface can be insecure解决方法;
- mysql5.0 Using a password on the command line interface can be insecure.最简单的解决办法
- Mysql Warning :Using a password on the command line...
- 解决MySQL5.6出现"Using a password on the command line interface..."
- MySQL5.6出现”Using a password on the command line interface…”解决办法
- MySQL 5.6 警告信息 command line interface can be insecure 修复
- MySQL5.6 Using a password on the command line inte
- This warning can be disabled by using the command line flag -Dcom.android.build.gradle.overridePath
- 新计划--天气数据采集与分析
- 【工具,组件类】登录,评论的验证码通过kaptcha的实现的方式
- 抽象类和接口
- 用Docker安装Gitlab
- logistic regression识别真假币
- zabbix监控mysql之Warning: Using a password on the command line interface can be insecure.
- pair、map、set、multiset、multimap用法简介
- 卷积的优化
- 【安全牛学习笔记】MSsql2005(Sa)权限执行命令总结
- 在mac下搭建tomcat服务器
- 朴素贝叶斯(三)进阶
- 悼狗烹哥——金柱赫
- [论文阅读] Low-shot Visual Recognition by Shrinking and Hallucinating Features
- 欢迎使用CSDN-markdown编辑器