Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

463
Visualizações
MediaWiki Docker container can't access MySQL Docker container

I'm trying to create 2 Docker containers, one containing a MySQL database and another containing Apache/PHP and MediaWiki. I'm using the latest images up on Docker Hub for MySQL and MediaWiki.

I'm creating the 2 containers using:

docker container run -d --name mediawiki --restart always -p 8080:80 mediawiki
docker container run -d --name mw-mysql -v mw-mysql:/var/lib/mysql -e MYSQL_ROOT_PASSWORD="Sup3rS3cret" -p 3306:3306 --restart always mysql

I'm not sure that I need to map the MySQL port (3306) since that's the default. I'm also pretty sure that nothing is listening on port 80 so I probably don't need to map it to 8080 either.

I also create a network and add both containers to the network:

docker network create mediawiki
docker network connect mediawiki mediawiki
docker network connect mediawiki mw-mysql

From the host where Docker is running, I can fire up a mysql client and connect to the MySQL database running in mw-mysql. If I log into the mediawiki container, I can ping the mw-mysql container.

The images are downloaded and created just fine but when I browse to the MediaWiki website at http://localhost:8080/ and start to configure MediaWiki, it can't connect to the database.

I've the following servers: "mw-mysql", "my-mysql.mediawiki", "localhost", "127.0.0.1" along with the userid "root" and the super secret password above.

I'm stumped. I'm also new to Docker. I must be doing something stupid but I just don't see it. All suggestions gratefully accepted.

over 4 years ago · Santiago Trujillo
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda