databacker / mysql-backup

image to enable automated backups of mysql databases in containers
636 stars 178 forks source link

DB_PORT by default is 0 in the newest versions like 1.0.0-rc #297

Closed lightsuner closed 5 months ago

lightsuner commented 5 months ago

I used the following image databack/mysql-backup:51c9ce6e97a5b864bef95767c707896b95a7916b. I omitted DB_PORT: 3306 row in my compose.yaml file and got the following error:

mysql_backup  | time="2024-04-07T18:03:13Z" level=debug msg="starting dump"
mysql_backup  | time="2024-04-07T18:03:13Z" level=info msg="beginning dump 2024-04-07T18:03:13Z"
mysql_backup  | Error: error running command: error running command: error running dump: failed to list database schemas: could not get schemas: dial tcp 172.20.0.3:0: connect: connection refused
mysql_backup  | time="2024-04-07T18:03:13Z" level=fatal msg="error running command: error running command: error running dump: failed to list database schemas: could not get schemas: dial tcp 172.20.0.3:0: connect: connection refused"
mysql_backup exited with code 1

My compose.yaml file is:

mysql_backup:
    command: dump -v 2
    container_name: mysql_backup
    depends_on:
      mysql:
        condition: service_healthy
        required: true
    environment:
      AWS_ACCESS_KEY_ID: werwerwerwerwerewr
      AWS_DEFAULT_REGION: us-east-1
      AWS_REGION: us-east-1
      AWS_SECRET_ACCESS_KEY: sadasdasdadasdasdasdasdasd
      COMPRESSION: gzip
      DB_DUMP_DEBUG: "true"
      DB_DUMP_FREQ: "1440"
      DB_DUMP_TARGET: s3://name-of-the-bucket/
      DB_NAMES: "db1 db2"
      DB_PASS: PASSWORD
      DB_SERVER: mysql
      DB_USER: root
      NICE: "true"
      TZ: UTC
    image: databack/mysql-backup:51c9ce6e97a5b864bef95767c707896b95a7916b
    networks:
      default: null
    restart: unless-stopped
deitch commented 5 months ago

Yeah, looks like it. Easy enough to fix, though.