I granted REPLICATION SLAVE 
GRANT PROCESS, REPLICATION CLIENT, REPLICATION SLAVE, SELECT ON *.* TO 
'mysqld_exporter'@'localhost' WITH MAX_USER_CONNECTIONS 2;

as "Slave Monitor" privilege does not exist, and yes exporter worked 
correctly and started sending info to prometheus
On Friday, January 21, 2022 at 6:36:22 PM UTC+1 Brian Candler wrote:

> Try adding "SLAVE MONITOR" instead of "SUPER", as the error message says.
>
> On Friday, 21 January 2022 at 17:21:01 UTC [email protected] wrote:
>
>> Yes, I have granted what is stated on the url you mentioned but it did 
>> not work until I granted SUPER Status
>>
>> On Friday, January 21, 2022 at 4:58:21 PM UTC+1 Brian Candler wrote:
>>
>>> I would guess it's doing something like "show slave status" and needs 
>>> appropriate permissions.
>>>
>>> The required grants are documented here:
>>> https://github.com/prometheus/mysqld_exporter#required-grants
>>>
>>> On Friday, 21 January 2022 at 13:47:01 UTC [email protected] wrote:
>>>
>>>> I changed BindAdree to 0.0.0.0, restarted exporter, started getting
>>>>
>>>> Jan 21 13:20:47 puppetmaster29 mysqld_exporter[120483]: level=error 
>>>> ts=2022-01-21T12:20:47.712Z caller=exporter.go:174 msg="Error from 
>>>> scraper" 
>>>> scraper=slave_status err="Error 1227: Access denied; you need (at least 
>>>> one 
>>>> of) the SUPER, SLAVE MONITOR privilege(s) for this operation"
>>>> Jan 21 13:21:02 puppetmaster29 mysqld_exporter[120483]: level=error 
>>>> ts=2022-01-21T12:21:02.688Z caller=exporter.go:174 msg="Error from 
>>>> scraper" 
>>>> scraper=slave_status err="Error 1227: Access denied; you need (at least 
>>>> one 
>>>> of) the SUPER, SLAVE MONITOR privilege(s) for this operation"
>>>> Jan 21 13:21:17 puppetmaster29 mysqld_exporter[120483]: level=error 
>>>> ts=2022-01-21T12:21:17.684Z caller=exporter.go:174 msg="Error from 
>>>> scraper" 
>>>> scraper=slave_status err="Error 1227: Access denied; you need (at least 
>>>> one 
>>>> of) the SUPER, SLAVE MONITOR privilege(s) for this operation"
>>>> Jan 21 13:21:32 puppetmaster29 mysqld_exporter[120483]: level=error 
>>>> ts=2022-01-21T12:21:32.679Z caller=exporter.go:174 msg="Error from 
>>>> scraper" 
>>>> scraper=slave_status err="Error 1227: Access denied; you need (at least 
>>>> one 
>>>> of) the SUPER, SLAVE MONITOR privilege(s) for this operation"
>>>> Jan 21 13:21:47 puppetmaster29 mysqld_exporter[120483]: level=error 
>>>> ts=2022-01-21T12:21:47.684Z caller=exporter.go:174 msg="Error from 
>>>> scraper" 
>>>> scraper=slave_status err="Error 1227: Access denied; you need (at least 
>>>> one 
>>>> of) the SUPER, SLAVE MONITOR privilege(s) for this operation"
>>>> Jan 21 13:22:02 puppetmaster29 mysqld_exporter[120483]: level=error 
>>>> ts=2022-01-21T12:22:02.687Z caller=exporter.go:174 msg="Error from 
>>>> scraper" 
>>>> scraper=slave_status err="Error 1227: Access denied; you need (at least 
>>>> one 
>>>> of) the SUPER, SLAVE MONITOR privilege(s) for this operation"
>>>>
>>>> On Friday, January 21, 2022 at 12:42:51 PM UTC+1 Brian Candler wrote:
>>>>
>>>>> What do these show?
>>>>>
>>>>> telnet ::1 3306
>>>>> telnet localhost 3306
>>>>>
>>>>> The requirements for enabling mysql to accept IPv6 connections are 
>>>>> here:
>>>>> https://dev.mysql.com/doc/refman/5.7/en/ipv6-support.html
>>>>>
>>>>> Have you set bind_address=:: 
>>>>> <https://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html#sysvar_bind_address>
>>>>>  
>>>>> ?
>>>>>
>>>>> As for why it's using IPv6, my guess is that your /etc/hosts has 
>>>>> something like this:
>>>>>
>>>>> 127.0.0.1 localhost
>>>>> ::1 localhost
>>>>>
>>>>> One workaround is to change your exporter config to point to 
>>>>> "127.0.0.1" instead of "localhost".  Another workaround is to change 
>>>>> /etc/hosts to
>>>>>
>>>>> 127.0.0.1 localhost
>>>>> ::1 localhost6
>>>>>
>>>>> On Friday, 21 January 2022 at 10:38:20 UTC [email protected] 
>>>>> wrote:
>>>>>
>>>>>> You are correct, there is an issu coonnecting to SQL, I am not sure 
>>>>>> why it is trying to use [::1]. Anyway, I granted the user on this ipv6 
>>>>>> but 
>>>>>> still not able to connect
>>>>>> CREATE USER 'mysqld_exporter'@'::1' IDENTIFIED BY 'mysqld_exporter' 
>>>>>> WITH MAX_USER_CONNECTIONS 2;
>>>>>>
>>>>>> restarted the services but still getting
>>>>>>
>>>>>> Jan 21 11:21:47 puppetmaster29 mysqld_exporter[3863944]: level=error 
>>>>>> ts=2022-01-21T10:21:47.619Z caller=exporter.go:149 msg="Error pinging 
>>>>>> mysqld" err="dial tcp [::1]:3306: c>
>>>>>> Jan 21 11:22:02 puppetmaster29 mysqld_exporter[3863944]: level=error 
>>>>>> ts=2022-01-21T10:22:02.619Z caller=exporter.go:149 msg="Error pinging 
>>>>>> mysqld" err="dial tcp [::1]:3306: c>
>>>>>> Jan 21 11:22:17 puppetmaster29 mysqld_exporter[3863944]: level=error 
>>>>>> ts=2022-01-21T10:22:17.619Z caller=exporter.go:149 msg="Error pinging 
>>>>>> mysqld" err="dial tcp [::1]:3306: c>
>>>>>>
>>>>>> On Friday, January 21, 2022 at 9:04:36 AM UTC+1 Brian Candler wrote:
>>>>>>
>>>>>>> What do you get from:
>>>>>>>
>>>>>>> curl -sS 192.168.1.48:9104/metrics
>>>>>>>
>>>>>>> ?
>>>>>>>
>>>>>>> On Thursday, 20 January 2022 at 23:44:06 UTC [email protected] 
>>>>>>> wrote:
>>>>>>>
>>>>>>>> I have just successful setup and run mysql exporter, when I switch 
>>>>>>>> to Prometheus UI, try to search for sql metrics, I see only 4 items
>>>>>>>>
>>>>>>>> mysql_exporter_last_scrape_error
>>>>>>>> mysql_exporter_scrapes_total
>>>>>>>> mysql_up
>>>>>>>> mysqld_exporter_build_info
>>>>>>>>
>>>>>>>> in spite of the fact that I created a service file on Fedora 35 
>>>>>>>> with all following flags
>>>>>>>> ********************************************
>>>>>>>> [client]
>>>>>>>> user=mysqld_exporter
>>>>>>>> password=myuser
>>>>>>>>
>>>>>>>> [Unit]
>>>>>>>> Description=Prometheus MySQL Exporter
>>>>>>>> After=network.target
>>>>>>>> User=prometheus
>>>>>>>> Group=prometheus
>>>>>>>>
>>>>>>>> [Service]
>>>>>>>> Type=simple
>>>>>>>> Restart=always
>>>>>>>> ExecStart=/usr/local/bin/mysqld_exporter \
>>>>>>>> --config.my-cnf /etc/.mysqld_exporter.cnf \
>>>>>>>> --collect.global_status \
>>>>>>>> --collect.info_schema.innodb_metrics \
>>>>>>>> --collect.auto_increment.columns \
>>>>>>>> --collect.info_schema.processlist \
>>>>>>>> --collect.binlog_size \
>>>>>>>> --collect.info_schema.tables.databases \
>>>>>>>> --collect.info_schema.tablestats \
>>>>>>>> --collect.global_variables \
>>>>>>>> --collect.info_schema.query_response_time \
>>>>>>>> --collect.info_schema.userstats \
>>>>>>>> --collect.info_schema.tables \
>>>>>>>> --collect.perf_schema.tablelocks \
>>>>>>>> --collect.perf_schema.file_events \
>>>>>>>> --collect.perf_schema.eventswaits \
>>>>>>>> --collect.perf_schema.indexiowaits \
>>>>>>>> --collect.perf_schema.tableiowaits \
>>>>>>>> --collect.perf_schema.memory_events \
>>>>>>>> --collect.slave_status \
>>>>>>>> --web.listen-address=192.168.1.48:9104
>>>>>>>>
>>>>>>>> [Install]
>>>>>>>> WantedBy=multi-user.target
>>>>>>>>
>>>>>>>> ***********************************************
>>>>>>>>
>>>>>>>> It starts succesfuly by running the service status in green and no 
>>>>>>>> errors. Thanks for your help
>>>>>>>>
>>>>>>>>

-- 
You received this message because you are subscribed to the Google Groups 
"Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/prometheus-users/45b94832-d554-49f4-8a90-119918050af7n%40googlegroups.com.

Reply via email to