请教:mysql5.7使用mysqld_exporter监控,报权限问题
使用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有其他的设置?