psi-4ward / docker-powerdns

PowerDNS Docker Image based on Alpine
107 stars 110 forks source link

Always show Can't connect to MySQL server on 'mysql' (115) #31

Open gaankdoank opened 4 years ago

gaankdoank commented 4 years ago

Hi psitrax,

i've pulled this container and run on my host, but it always show Can't connect to MySQL server on 'mysql' (115), whereas i've configured mysql host.

Please help me, thanks,.

psi-4ward commented 4 years ago

Could you solve your problem?

patrickscottbest commented 4 years ago

This seems like a dead issue. Perhaps @gaankdoank specified the MYSQL_HOST as "mysql" which either should have resolved for him, or not... I guess we'll never know!

pciavald commented 3 years ago

Strangely i'm getting the same issue, i don't understand why. My docker-compose was giving this log and I tried the docker commands on the readme, same result.

My docker-compose:

version: '3'

services:

  pdns:
    image: psitrax/powerdns:latest
    container_name: pdns
    restart: always
    ports:
      - 53:53
      - 53:53/udp
    links:
      - pdns-db:mysql
    expose:
      - 8081
    environment:
      MYSQL_USER: root
      MYSQL_PASS: secret
      MYSQL_PORT: 3306

  pdns-db:
    image: mariadb:10.1
    container_name: pdns-db
    restart: always
    expose:
      - 3306
    environment:
      MYSQL_ROOT_PASSWORD: secret
    volumes: 
      - ./db:/var/lib/mysql

  admin:
    image: ngoduykhanh/powerdns-admin:latest
    container_name: pdns-admin
    restart: always
    ports:
      - 9191:80
    links:
      - pdns:pdns
    volumes:
      - admin-data:/data

volumes:
  admin-data:
[peac@thinkpad-centos powerDNS]$ docker-compose up
Creating volume "powerdns_admin" with default driver
Starting pdns-db ... done
Starting pdns    ... done
Recreating pdns-admin ... done
Attaching to pdns-db, pdns, pdns-admin
pdns       | ERROR 2002 (HY000): Can't connect to MySQL server on 'mysql' (115)
pdns-db    | 2020-11-30 22:35:13+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 1:10.1.48+maria-1~bionic started.
pdns       | Waiting for database to come up
pdns-db    | 2020-11-30 22:35:13+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
pdns-db    | 2020-11-30 22:35:13+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 1:10.1.48+maria-1~bionic started.
pdns-db    | 2020-11-30 22:35:14 140720162519040 [Note] mysqld (mysqld 10.1.48-MariaDB-1~bionic) starting as process 1 ...
pdns-db    | 2020-11-30 22:35:14 140720162519040 [Note] InnoDB: Using mutexes to ref count buffer pool pages
pdns-db    | 2020-11-30 22:35:14 140720162519040 [Note] InnoDB: The InnoDB memory heap is disabled
pdns-db    | 2020-11-30 22:35:14 140720162519040 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
pdns-db    | 2020-11-30 22:35:14 140720162519040 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
pdns-db    | 2020-11-30 22:35:14 140720162519040 [Note] InnoDB: Compressed tables use zlib 1.2.11
pdns-db    | 2020-11-30 22:35:14 140720162519040 [Note] InnoDB: Using Linux native AIO
pdns-db    | 2020-11-30 22:35:14 140720162519040 [Note] InnoDB: Using SSE crc32 instructions
pdns-db    | 2020-11-30 22:35:14 140720162519040 [Note] InnoDB: Initializing buffer pool, size = 256.0M
pdns-db    | 2020-11-30 22:35:14 140720162519040 [Note] InnoDB: Completed initialization of buffer pool
pdns-db    | 2020-11-30 22:35:14 140720162519040 [Note] InnoDB: Highest supported file format is Barracuda.
pdns-db    | 2020-11-30 22:35:14 140720162519040 [Note] InnoDB: The log sequence number 1616723 in ibdata file do not match the log sequence number 1616743 in the ib_logfiles!
pdns-db    | 2020-11-30 22:35:14 140720162519040 [Note] InnoDB: Restoring possible half-written data pages from the doublewrite buffer...
pdns-db    | 2020-11-30 22:35:14 140720162519040 [Note] InnoDB: 128 rollback segment(s) are active.
pdns-db    | 2020-11-30 22:35:14 140720162519040 [Note] InnoDB: Waiting for purge to start
pdns-db    | 2020-11-30 22:35:14 140720162519040 [Note] InnoDB:  Percona XtraDB (http://www.percona.com) 5.6.49-89.0 started; log sequence number 1616743
pdns-db    | 2020-11-30 22:35:14 140720162519040 [Note] Plugin 'FEEDBACK' is disabled.
pdns-db    | 2020-11-30 22:35:14 140719201187584 [Note] InnoDB: Dumping buffer pool(s) not yet started
pdns-db    | 2020-11-30 22:35:14 140720162519040 [Note] Recovering after a crash using tc.log
pdns-db    | 2020-11-30 22:35:14 140720162519040 [Note] Starting crash recovery...
pdns-db    | 2020-11-30 22:35:14 140720162519040 [Note] Crash recovery finished.
pdns-db    | 2020-11-30 22:35:14 140720162519040 [Note] Server socket created on IP: '::'.
pdns-db    | 2020-11-30 22:35:14 140720162519040 [Warning] 'proxies_priv' entry '@% root@98115d7bdc8a' ignored in --skip-name-resolve mode.
pdns-db    | 2020-11-30 22:35:14 140720162519040 [Note] mysqld: ready for connections.
pdns-db    | Version: '10.1.48-MariaDB-1~bionic'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  mariadb.org binary distribution
pdns-admin | INFO  [alembic.runtime.migration] Context impl SQLiteImpl.
pdns-admin | INFO  [alembic.runtime.migration] Will assume non-transactional DDL.
pdns-admin | INFO  [alembic.runtime.migration] Running upgrade  -> 787bdba9e147, Init DB
pdns-admin | INFO  [alembic.runtime.migration] Running upgrade 787bdba9e147 -> 59729e468045, Add view column to setting table
pdns-admin | INFO  [alembic.runtime.migration] Running upgrade 59729e468045 -> 1274ed462010, Change setting.value data type
pdns-admin | INFO  [alembic.runtime.migration] Running upgrade 1274ed462010 -> 4a666113c7bb, Adding Operator Role
pdns-admin | INFO  [alembic.runtime.migration] Running upgrade 4a666113c7bb -> 31a4ed468b18, Remove all setting in the DB
pdns-admin | INFO  [alembic.runtime.migration] Running upgrade 31a4ed468b18 -> 654298797277, Upgrade DB Schema
pdns-admin | INFO  [alembic.runtime.migration] Running upgrade 654298797277 -> 0fb6d23a4863, Remove user avatar
pdns-admin | INFO  [alembic.runtime.migration] Running upgrade 0fb6d23a4863 -> 856bb94b7040, Add comment column in domain template record table
pdns-admin | INFO  [alembic.runtime.migration] Running upgrade 856bb94b7040 -> b0fea72a3f20, Update domain serial columns type
pdns-admin | INFO  [alembic.runtime.migration] Running upgrade b0fea72a3f20 -> 3f76448bb6de, Add user.confirmed column
pdns-admin | [2020-11-30 22:35:19 +0000] [1] [INFO] Starting gunicorn 20.0.4
pdns-admin | [2020-11-30 22:35:19 +0000] [1] [INFO] Listening at: http://0.0.0.0:80 (1)
pdns-admin | [2020-11-30 22:35:19 +0000] [1] [INFO] Using worker: sync
pdns-admin | [2020-11-30 22:35:19 +0000] [10] [INFO] Booting worker with pid: 10
pdns-admin | [2020-11-30 22:35:19 +0000] [11] [INFO] Booting worker with pid: 11
pdns-admin | [2020-11-30 22:35:19 +0000] [12] [INFO] Booting worker with pid: 12
pdns-admin | [2020-11-30 22:35:19 +0000] [13] [INFO] Booting worker with pid: 13
pdns       | ERROR 2002 (HY000): Can't connect to MySQL server on 'mysql' (115)
pdns       | Waiting for database to come up
pdns       | ERROR 2002 (HY000): Can't connect to MySQL server on 'mysql' (115)
pdns       | Waiting for database to come up
pdns       | ERROR 2002 (HY000): Can't connect to MySQL server on 'mysql' (115)
pdns       | Waiting for database to come up
pdns       | ERROR 2002 (HY000): Can't connect to MySQL server on 'mysql' (115)
pdns       | Waiting for database to come up