Docker Community Forums

Share and learn in the Docker community.

-SOLVED- Mediawiki - DB connection error: No such file or directory (localhost)


(Fbonanno) #1

Hi all,

I succesfully compose an instance of mediawiki and the webserver works, but during the configuration of the platform (via web) it shows the error in the object: “DB connection error: No such file or directory (localhost).”.
Here are some info:

OS - Windows 10
Docker version - 18.06.1-ce
YAML - below:

# MediaWiki with MariaDB
#
# Access via "http://localhost:8080"
#   (or "http://$(docker-machine ip):8080" if using docker-machine)
version: '3'
services:
  mediawiki:
    image: mediawiki
    restart: always
    ports:
      - 8080:80
    links:
      - database
    volumes:
      - db_wiki:/var/www/html/images
      # After initial setup, download LocalSettings.php to the same directory as
      # this yaml and uncomment the following line and use compose to restart
      # the mediawiki service
      # - ./LocalSettings.php:/var/www/html/LocalSettings.php
  database:
    image: mysql:5.7
    restart: always
    environment:
      MYSQL_DATABASE: wiki
      MYSQL_USER: root
      MYSQL_PASSWORD: password
      #MYSQL_RANDOM_ROOT_PASSWORD: yes
      MYSQL_ROOT_PASSWORD: password
volumes:
    db_wiki:

Can someone help me to find the problem?
Thank you very much!


(Fbonanno) #2

Solved.
In the configuration interface (Mediawiki) i putted “database” instead of “localhost”…