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

Document socket-based access #657

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

kasimon
Copy link

@kasimon kasimon commented Sep 5, 2022

If mysqld_exporter runs on the same system as the database, socket based authentication removes the need to manage a password.

Signed-off-by: Karsten Heymann karsten.heymann@gmail.com

If mysqld_exporter runs on the same system as the database, socket based authentication removes the need to manage a password.

Signed-off-by: Karsten Heymann <karsten.heymann@gmail.com>

```shell
## run as user mysqld_exporter:
export DATA_SOURCE_NAME="mysqld_exporter:@unix(/var/run/mysqld/mysqld.sock)/"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, but we need to update this to use the new config file format or command line flag (--mysqld.address=).

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How would the new format look like?

i tried both, but it doesn't seem to work:

--mysqld.address="unix(/var/run/mariadb/mysql.sock)"

2023-07-05T16:16:30.833935+02:00 db mariadb_exporter[3181430]: ts=2023-07-05T14:16:30.832Z caller=mysqld_exporter.go:225 level=info msg="Error parsing host config" file=.my.cnf err="failed to parse address: address unix(/var/run/mariadb/mysql.sock): missing port in address"
--mysqld.address="unix:///var/run/mariadb/mysql.sock"

2023-07-05T16:17:31.077223+02:00 db mariadb_exporter[3181808]: ts=2023-07-05T14:17:31.075Z caller=config.go:146 level=error msg="failed to parse config" section=client err="set field \"port\": strconv.ParseInt: parsing \"///var/run/mariadb/mysql.sock\": invalid syntax"

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

Successfully merging this pull request may close these issues.

None yet

3 participants