Docker4drupal: Failed to connect to your database server

Created on 14 Feb 2017  路  3Comments  路  Source: wodby/docker4drupal

Docker-compose went well but when I get to the Set up database section of the install using
Database name: drupal
Database username: drupal
Database password: drupal

I get the following error:
Failed to connect to your database server. The server reports the following message: SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/run/mysqld/mysqld.sock' (2 "No such file or directory").

Docker newbie here, thanks

question

Most helpful comment

Hi, you should use mariadb (service name in docker-compose.yaml) as mariadb hostname not localhost.

All 3 comments

Hi, you should use mariadb (service name in docker-compose.yaml) as mariadb hostname not localhost.

Thanks, PavelPrischepa, sorry about my slow response. Life threw me a hiccup. >:-|

I did make that change but now seems to be getting hung up while getting ready for start up. It just keeps repeating the last line from the following terminal reprint:

mariadb_1 |
mariadb_1 | MySQL init process done. Ready for start up.
mariadb_1 |
mariadb_1 | 2017-02-16 19:25:50 139722183236392 [Note] mysqld (mysqld 10.1.19-MariaDB) starting as process 1 ...
mariadb_1 | 2017-02-16 19:25:50 139722183236392 [Note] InnoDB: Using mutexes to ref count buffer pool pages
mariadb_1 | 2017-02-16 19:25:50 139722183236392 [Note] InnoDB: The InnoDB memory heap is disabled
mariadb_1 | 2017-02-16 19:25:50 139722183236392 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
mariadb_1 | 2017-02-16 19:25:50 139722183236392 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
mariadb_1 | 2017-02-16 19:25:50 139722183236392 [Note] InnoDB: Compressed tables use zlib 1.2.8
mariadb_1 | 2017-02-16 19:25:50 139722183236392 [Note] InnoDB: Using Linux native AIO
mariadb_1 | 2017-02-16 19:25:50 139722183236392 [Note] InnoDB: Using generic crc32 instructions
mariadb_1 | 2017-02-16 19:25:50 139722183236392 [Note] InnoDB: Initializing buffer pool, size = 1.0G
mariadb_1 | 2017-02-16 19:25:50 139722183236392 [Note] InnoDB: Completed initialization of buffer pool
mariadb_1 | 2017-02-16 19:25:50 139722183236392 [Note] InnoDB: Highest supported file format is Barracuda.
mariadb_1 | 2017-02-16 19:25:50 139722183236392 [Note] InnoDB: 128 rollback segment(s) are active.
mariadb_1 | 2017-02-16 19:25:50 139722183236392 [Note] InnoDB: Waiting for purge to start
mariadb_1 | 2017-02-16 19:25:50 139722183236392 [Note] InnoDB: Percona XtraDB (http://www.percona.com) 5.6.32-79.0 started; log sequence number 1623701
mariadb_1 | 2017-02-16 19:25:50 139720945838768 [Note] InnoDB: Dumping buffer pool(s) not yet started
mariadb_1 | 2017-02-16 19:25:50 139722183236392 [Note] Plugin 'FEEDBACK' is disabled.
mariadb_1 | 2017-02-16 19:25:51 139722183236392 [Note] Server socket created on IP: '0.0.0.0'.
mariadb_1 | 2017-02-16 19:25:51 139722183236392 [Warning] 'proxies_priv' entry '@% root@e77abb84c89e' ignored in --skip-name-resolve mode.
mariadb_1 | 2017-02-16 19:25:51 139722183236392 [Note] Reading of all Master_info entries succeded
mariadb_1 | 2017-02-16 19:25:51 139722183236392 [Note] Added new Master_info '' to hash table
mariadb_1 | 2017-02-16 19:25:51 139722183236392 [Note] mysqld: ready for connections.
mariadb_1 | Version: '10.1.19-MariaDB' socket: '/var/run/mysqld/mysqld.sock' port: 3306 MariaDB Server
mailhog_1 | [APIv1] KEEPALIVE /api/v1/events
mailhog_1 | [APIv1] KEEPALIVE /api/v1/events
mailhog_1 | [APIv1] KEEPALIVE /api/v1/events
mailhog_1 | [APIv1] KEEPALIVE /api/v1/events
mailhog_1 | [APIv1] KEEPALIVE /api/v1/events
mailhog_1 | [APIv1] KEEPALIVE /api/v1/events

It does that until I hit CTR C

Thanks again for your help!

Bill

Try to remove volumes from mariadb service definition then docker-compose down and docker-compose up.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Vacilando picture Vacilando  路  7Comments

2dareis2do picture 2dareis2do  路  11Comments

jzavrl picture jzavrl  路  3Comments

AminSarafraz picture AminSarafraz  路  4Comments

LordFransie picture LordFransie  路  3Comments