mysqld_exporter
mysqld_exporter copied to clipboard
The priority of the mysql port
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?