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

MYSQLD_EXPORTER_PASSWORD cannot be parsed correctly #821

Open
hzfq opened this issue Feb 27, 2024 · 2 comments
Open

MYSQLD_EXPORTER_PASSWORD cannot be parsed correctly #821

hzfq opened this issue Feb 27, 2024 · 2 comments

Comments

@hzfq
Copy link

hzfq commented Feb 27, 2024

i am using mysqld-exporter by docker compose, my docker-compose.yml is

version: "3"
services:
  mysql-exporter:
    image: prom/mysqld-exporter:v0.15.1
    container_name: mysql-exporter
    restart: always
    privileged: true
    user: root
    networks:
      - default
    ports:
      - 39104:9104
    environment:
      MYSQLD_EXPORTER_PASSWORD: 'xx$kXxxxx*abc'
    command:
      - "--mysqld.address=localhost:3306"
      - "--mysqld.username=root"
networks:
  default:
    driver: bridge

when i am starting with docker compose up -d, occuring error like following

WARN[0000] The "kBl9DVR" variable is not set. Defaulting to a blank string.

in addition, i am tried "xx\$kXxxxx*abc", but error still exist,

parsing /opt/mysql-exporter/docker-compose.yml: yaml: line 14: found unknown escape character

so, how to add password of mysql to mysqld-exporter?

@ZeroSums
Copy link

Unsure if you've figured it out, but I assume the issue is your MYSQLD_EXPORTER_PASSWORD var.

You need to escape $ with another $ i.e:

MYSQLD_EXPORTER_PASSWORD: 'xx$$kXxxxx*abc'

Please read the docs for a more detailed explanation:

@ZeroSums
Copy link

@SuperQ Do you guys still maintain this repo? It appears a lot of these issues are merely user error and not related to the actual repo

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

2 participants