diff --git a/CHANGELOG.md b/CHANGELOG.md index 3eb28d82c..fa1219f95 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,8 +2,12 @@ BREAKING CHANGES: +The default client configuration file is now `.my.cnf` in the process working directory. Use `--config.my-cnf="$HOME/.my.cnf"` to retain the previous default. + Changes: +* [CHANGE] Don't use HOME env in the my-cnf config path. #745 + * [CHANGE] * [FEATURE] * [ENHANCEMENT] diff --git a/README.md b/README.md index 1040b55a5..d942e2e56 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ NOTE: It is recommended to set a max connection limit for the user to avoid over ##### Single exporter mode -Running using ~/.my.cnf: +Running using `.my.cnf` from the current directory: ./mysqld_exporter diff --git a/mysqld_exporter.go b/mysqld_exporter.go index 88b0ea865..76fb107bf 100644 --- a/mysqld_exporter.go +++ b/mysqld_exporter.go @@ -17,7 +17,6 @@ import ( "context" "net/http" "os" - "path" "strconv" "time" @@ -48,7 +47,7 @@ var ( configMycnf = kingpin.Flag( "config.my-cnf", "Path to .my.cnf file to read MySQL credentials from.", - ).Default(path.Join(os.Getenv("HOME"), ".my.cnf")).String() + ).Default(".my.cnf").String() mysqldAddress = kingpin.Flag( "mysqld.address", "Address to use for connecting to MySQL",