Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

449
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!