Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker: my.cnf => 'No such file or directory' #790

Open
SK-StYleZ opened this issue Dec 7, 2023 · 4 comments
Open

Docker: my.cnf => 'No such file or directory' #790

SK-StYleZ opened this issue Dec 7, 2023 · 4 comments

Comments

@SK-StYleZ
Copy link

Host operating system: output of uname -a

Linux home 6.1.21-v8+ #1642 SMP PREEMPT Mon Apr 3 17:24:16 BST 2023 aarch64 GNU/Linux

mysqld_exporter version: output of mysqld_exporter --version

latest

MySQL server version

latest

mysqld_exporter command line flags

docker run -d
-p 9104:9104
prom/mysqld-exporter:latest
--config.my-cnf=./my.cnf
d7c0d75852982e7182b260df7569be11b71bcde238b99f2e6a7f8d8031fa8cdc
-bash: --config.my-cnf=./my.cnf: No such file or directory

the "my.cnf" is in the current working directory
the format of "my.cnf" is the same as in the documentation:
[client] user = foo password = foo123 [client.servers] user = bar password = bar123

What did you do that produced an error?

What did you expect to see?

running exporter

What did you see instead?

an error

can someone please provide an working docker // docker-compose.yaml example?

@SK-StYleZ
Copy link
Author

please update the docker documentaion, it's incorrect ...

@kavishan-thathsara
Copy link

Having same issue. How did this fix?

@imamhadid
Copy link

https://github.com/prometheus/mysqld_exporter/blob/main/README.md#single-exporter-mode
Running using .my.cnf from the current directory

try using .my.cnf not my.cnf

@SK-StYleZ
Copy link
Author

SK-StYleZ commented Feb 14, 2024

Thanks for the respond.
I'm using mysqld_exporter with docker.

This is the official documentation for docker: https://github.com/prometheus/mysqld_exporter/blob/main/README.md#using-docker
I've tried this:

docker run -d \
  -p 9104:9104 \
  --network my-mysql-network  \
  prom/mysqld-exporter
  --config.my-cnf=./my.cnf
49ab1417a4f779e6f77dd740ce7d767401a1d055c90f429b9b7e2e9c28ab2e35
docker: Error response from daemon: network my-mysql-network not found.
-bash: --config.my-cnf=./my.cnf: No such file or directory

And this:

docker run -d \
  -p 9104:9104 \
  --network my-mysql-network  \
  prom/mysqld-exporter
  --config.my-cnf=.my.cnf
9ce928b319b21270219a8ac1fc3281f84ed5eb89adc69541f5cfe26a2f62da08
docker: Error response from daemon: network my-mysql-network not found.
-bash: --config.my-cnf=.my.cnf: command not found

In the current directory is an my.cnf:

ls
docker-compose.yml  my.cnf

Dear maintainers/devs please fix this or update the documentation.
Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants