mysql port

197 views
Skip to first unread message

Dimitri Gesquiere

unread,
May 28, 2021, 12:35:05 PM5/28/21
to Prometheus Users

Is it possible to use prometheus exporter when mysql is running on a different port then 3306? When i change the /etc/.mysqld_exporter.cnf file for looking at another port. it still tries to connect with port 3306. changes i have made are.

[client]
user=mysqld_exporter
password=apassword
host=localhost:portnumber

exporter service is running with error
level=error msg="Error pinging mysqld: dial tcp: lookup localhost:45654:3306:

Dimitri Gesquiere

unread,
May 31, 2021, 1:14:15 AM5/31/21
to Prometheus Users
No one?

Op vrijdag 28 mei 2021 om 18:35:05 UTC+2 schreef Dimitri Gesquiere:

elitesai

unread,
May 31, 2021, 4:33:50 AM5/31/21
to Prometheus Users
Did you see https://github.com/prometheus/mysqld_exporter#setting-the-mysql-servers-data-source-name?
It reads like you will need to export the MySQL server connection in the DATA_SOURCE_NAME if you change the default values.

Ben Kochie

unread,
May 31, 2021, 5:32:45 AM5/31/21
to Dimitri Gesquiere, Prometheus Users
If you read the MySQL documentation, you will see that "port" is a separate configuration key from "host". Putting the port in the host is not supported.


--
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 prometheus-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/952f147e-9ef4-4475-afe0-c232a879b46en%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages