mysqld_exporter icon indicating copy to clipboard operation
mysqld_exporter copied to clipboard

The priority of the mysql port

Open zijie1024 opened this issue 8 months ago • 0 comments

When MySQL is deployed using Docker, the port mapping is 10000:3306, and the port configured in my.cnf is 3306 (default). mysql-exporter is also deployed using Docker, and the MySQL address is specified in the startup command with --mysqld.address="10.0.4.9:10000". However, from the logs, it can be seen that mysql-exporter still uses the port configured in my.cnf (i.e., 3306) instead of the port 10000 specified in --mysqld.address.

A better approach would be for the priority of the command line to be higher than that of the configuration file. Alternatively, without modifying my.cnf, is there another way to specify the MySQL port?

Image

zijie1024 avatar Apr 26 '25 13:04 zijie1024