Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MediaWiki Docker Official Image - Connection Refused by MySQL

I'm trying to install MediaWiki using the official docker image at MediaWiki Docker Official Image

I'm on a Windows 10 box and used docker-compose with the stack.yml file that the page has on the instructions.

It all deploys and starts, but when I connect and try to run the initial configuration, I run into errors.

I changed the database username to "wikiuser" and use "example" as the password - as set in the yml file. When I click "Continue" I get

Cannot access the database: :real_connect(): (HY000/2002): No such file or directory.

If I change the "Database host" from localhost to 127.0.0.1, I get: Cannot access the database: :real_connect(): (HY000/2002): Connection refused.

I even tried it in the "Try in PWD" link and had the same results on the "Play with Docker" virtual machine.

Is something missing from the yml file? I also tried adding a ports setting in the yml file and exposed 3306:3306, but got the same results.

Any ideas?

like image 987
Perlguy Avatar asked Aug 01 '19 15:08

Perlguy


1 Answers

Ugh. I got it to work by changing the Database host to simply database Or to the name of the database-service in docker-compose file if you changed it.

This should probably be in their setup documentation.

like image 96
Perlguy Avatar answered Sep 24 '22 23:09

Perlguy