Open tsembhi opened 4 years ago
I'm using this config: mysql Ver 15.1 Distrib 10.4.11-MariaDB, for osx10.14 (x86_64) using readline 5.1 mysql Ver 15.1 Distrib 10.3.11-MariaDB, for Linux (x86_64) using readline 5.1
Sorry, I don't have a MySQL setup to test right now. Tested on OSX and Linux (CentOS 7).
My client config looks like this:
[client]
user=user-monitor-ro
passord=MymagIcpasswOrd
I can run the exporter with these commands:
./mysqld_exporter --config.my-cnf /tmp/my.cnf
./mysqld_exporter --config.my-cnf ~/my.cnf
./mysqld_exporter
Note: I moved the client config to test multiple solutions. By default, MySQL client is looking for ~/.my.cnf
, so you can move your client config somewhere else if that is bothering you.
Even with my client config ~/.my.cnf
I'm able to login with another user with the following command:
mysql -u myotheruser -h mysupermysqlserver -p
Did you try those solutions:
~
.-u
option to connect with another user.My configuration is OK. My configuration is as follows: /usr/local/mysqld_exporter mysqld_exporter --config.my-cnf =/usr/local/mysqld_exporter/. my.cnf
In addition, the password in.my.cnf can be set as a simple point, or avoid the use of.
We cannot use
config.my-cnf
flag with alternative login path for mysqld_exporter user. The default isclient
(and seems to be hard-coded) However when usingclient
, this causes issues when logging as other users using the credentials file:Although the
login-path
has been specified assqladmin
, it has logged in using theclient
login-path
. Now this maybe a bug in mysql, however I would expect there to be way to set the login-path for the mysqld_exporter.Host operating system: output of uname -a
mysqld_exporter version: output of mysqld_exporter --version
MySQL server version