请教:mysql5.7使用mysqld_exporter监控,报权限问题

IT_YAO_18756487745 IT_YAO_18756487745 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
使用mysqld_exporter对公司的mysql进行监控,报msg="Error pinging mysqld: Error 1045: Access denied for user 'exporter'@'localhost' (using password: YES)" source="mysqld_exporter.go:268"

mysqld_exporter版本mysqld_exporter-0.10.0.linux-amd64
msyql版本5.7.26

操作步骤:
1,root登陆mysql
2, 新建用户并赋权
GRANT REPLICATION CLIENT, PROCESS ON *.* TO 'exporter'@'localhost' identified by '123456';
GRANT SELECT ON *.* TO 'exporter'@'localhost';
flush privileges;
3,创建.my.cnf文件 vi .my.cnf:
[client]
user=exporter
password=123456
4, 执行nohup ./mysqld_exporter -config.my-cnf=.my.cnf &
结果报错msg="Error pinging mysqld: Error 1045: Access denied for user 'exporter'@'localhost' (using password: YES)" source="mysqld_exporter.go:268"

关键是,使用Mysql-5.6.25的版本采取同样的操作就没问题

5.6版本是自己虚拟机的,5.7的是公司的,总不能改版本吧

从报错上看,应该还是权限的问题,试过'exporter'@'%' 不行,试过user=root也不行,都是报同样的错误
是不是mysql5.7有其他的设置?
...全文

相关推荐

评论 2
收藏 已收藏
分享
返回顶部
IT_YAO_18756487745
MySQL 57,062 成员 56,759 内容