Warning: Using a password on the command line interface can be insecure.解决办法

栏目: 数据库 · 发布时间: 8年前

内容简介: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.解决办法

此问题在zabbix监控mysql的时候出现:

Warning: Using a password on the command line interface can be insecure.解决办法

zabbix调用脚本对mysql进行监控,脚本如下:

result=`/usr/local/mysql/bin/mysqladmin -u$MYSQL_USER -h$MYSQL_HOST -p${MYSQL_PWD} -S $MYSQL_SOCK extended-status |grep -w "Com_select"|cut -d"|" -f3`

很明显,这是因为zabbix获取到的值并不是想要的数值类型,而是文本类型,才有上面报错信息。

在agent上执行这条命令结果为:

Warning: Using a password on the command line interface can be insecure.解决办法

有一条警告信息,意思是说你在命令行里输入密码是不安全的。

原来这种情况在mysql5.6.X版本中才会出现,解决方法如下:

1.If your MySQL client/server version is a 5.6.x a way to avoid the WARNING message are using the mysql_config_editor tools:

mysql_config_editor set --login-path=local --host=localhost --user=username --password

2.Then you can use in your shell script:

mysql --login-path=local -e "statement"

instead of:

mysql -u username -p pass -e "statement"

这样设置之后,在脚本里也全部写成这个样子,重启agent后,zabbix web页面就正常了。

本文永久更新链接地址 http://www.linuxidc.com/Linux/2017-06/144755.htm


以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

四步创业法

四步创业法

[美] Steven Gary Blank / 七印部落 / 华中科技大学出版社 / 2012-8-1 / 48.00

《四步创业法》获李开复推荐,是精益创业理论的奠基之作。作者Steven Gary Blank博士是硅谷资深企业家,他一共创办了八家企业,并担任多家硅谷公司的董事和创业顾问。本书总结作者25年创业经验,提出全新的客户发展方法 (诣在弥补传统产品开发方法的缺陷) ,掀起了硅谷近年精益创业 的浪潮。七印部落正在翻译作者的博客和授课视频,欢迎访问微博:http://weibo.com/7seals ......一起来看看 《四步创业法》 这本书的介绍吧!

CSS 压缩/解压工具
CSS 压缩/解压工具

在线压缩/解压 CSS 代码

HTML 编码/解码
HTML 编码/解码

HTML 编码/解码

UNIX 时间戳转换
UNIX 时间戳转换

UNIX 时间戳转换