go-sql-driver / go-sql-driver/mysql
Add support to read from another config file in the DSN
- Dominant language
- Go
- Stars
- 15.3k
- Forks
- 2.3k
- Avg merge
- 2h 23m
- Merged PRs (30d)
- 10
Description
There is no support for reading a mysql configuration file as specified in the DSN. This is supported in other language bindings as read_default_file (or mysql_read_default_file). See https://bugs.mysql.com/bug.php?id=57081 for various examples. This is also supported as part of the C client library https://dev.mysql.com/doc/refman/8.0/en/mysql-options.html with its MYSQL_READ_DEFAULT_FILE option.
This makes it possible to specify for example the user and password (and host and port) in a central place, with tight file permissions instead of having to write these in places that are less desirable. In our case, we need to write the user/pass in the telegraf.conf file, and restrict the permissions, and duplicate the credentials that otherwise would be centralized in a single file.
Contributor guide
Assessment
This issue has not been assessed yet.