使用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有其他的設定?
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/49956.html
標籤:MySQL
上一篇:left連表查詢結果不一致問題
