Topic on Project:Support desk

Issues connecting MySQL container and MediaWiki Container on Docker

8
Squeak24 (talkcontribs)

Hi All

I am tryingto install MediaWiki using Docker. I am using Windows, but want to use Docker so I have more scope of what I can do. Long term I want to create my own image so I can have Parsoid and GraphViz running on it.

The issue I am getting is when I go onto the database page of the installation I get:

Cannot access the database: php_network_getaddresses: getaddrinfo failed: Name or service not known (mysqlhost).

Check the host, username and password and try again.


I have tried to create my own hostname for the MySQL running the line:

docker run --name=mysql1 -–network=mysqlhost -d mysql/mysql-server

But it comes up with the same error.

To get the container for MediaWiki working I have used:

docker run --name mediawiki -p 80:80 mediawiki

It looks like they are both working, just not talking to each other.

I have tried to link the MySQL up with MediaWiki as detailed on the MediaWiki Docker page using:

docker run --name mediawiki --link wiki:mysql -d mediawiki


But with that I get the error:


C:\Users\User>docker run --name mediawiki --link wiki:mysql -d mediawiki docker: Error response from daemon: Conflict. The container name "/mediawiki" is already in use by container "eb03498d223748379186507fe6d58e1cb7f59f4f2de3e6e1ba863d5b8210bf3c". You have to remove (or rename) that container to be able to reuse that name. See 'docker run --help'.

So I tried:

docker run --name wiki --link wiki:mysql -d mediawiki


But I get the error:

C:\Users\User>docker run --name wiki --link wiki:mysql -d mediawiki docker: Error response from daemon: could not get container for wiki: No such container: wiki. See 'docker run --help'.

Not sure what I am doing wrong, any help is appreciated,


Ciencia Al Poder (talkcontribs)

You use "docker run" to create a new container. Once you do that, you can't use the same name, unless you destroy that container. Try "docker rm mediawiki" to remove it and recreate it again.

Once you have the container created, and stop it, you can start it again with "docker start mediawiki"

Squeak24 (talkcontribs)

I get that, I just can't seem to get the MediaWiki container to talk to the MySQL container. I found this which indicates the MySQL host is mysql in my case.

199.58.99.202 (talkcontribs)

This is an issue for me as well. is there any resolution that has been found?

Ciencia Al Poder (talkcontribs)
Squeak24 (talkcontribs)

I have, but other work commitments came up. I am hoping to have a site down in the next few weeks now things are getting quieter again. But this is still an issue I am facing.

73.237.69.190 (talkcontribs)

I had a similar issue. When I used the database container name as the localhost, then I was able to complete the installation. My container name was mariadb.

2003:D5:272E:8289:6C3D:AEDE:C10C:A5A3 (talkcontribs)

This one helped me to. Use the container name of the database instead of localhost or 127.0.0.1.

Reply to "Issues connecting MySQL container and MediaWiki Container on Docker"