Docker Community Forums

Share and learn in the Docker community.

"Cannot access the database: No such file or directory (localhost:3306)" error during "Connect to database" installation Mediawiki step


#1

Hello,
Could you advise what could be the error.

I faced with “Cannot access the database: No such file or directory (localhost:3306)” error during “Connect to database” mediawiki installtion step. I am truing install Mediawiki on Windows and downloaded Mediawiki image with command: docker pull mediawiki.

I run new container with command like bellow

docker run --name <new_container_name> -e MYSQL_ROOT_PASSWORD=mysecretpassword –p 8080:80 -d <image_name>

Run new mediawiki container with command like bellow

docker run --link mysql:db -p 80:80 -p 443:443 -d simplyintricate/mediawiki

I receive “Cannot access the database: No such file or directory (localhost)” error message when I specify MySql credentials during “Connect to database” step.

I checked next images bellow from Docker hub:

  • mediawiki (1.31) - “Cannot access…” error
  • simplyintricate/mediawiki (1.29 ver) - “Cannot access…” error
  • wikimedia/mediawiki – mediawiki is not available at all (http://localhost)

synctree/mediawiki – mediawiki is not available at all (http://localhost), and I couldnot enter to mediawiki container (docker exec –it mediawiki_ synctree bash).

MySql 3306 port is available in PowerShell:

PS C:\Users\mpav> TNC -ComputerName localhost -Port 3306

ComputerName : localhost

RemoteAddress : ::1

RemotePort : 3306

InterfaceAlias : Loopback Pseudo-Interface 1

SourceAddress : ::1

TcpTestSucceeded : True

I tried link Mediawiki container to MySql container, but this did not help.

I installed MySql server on my PC. TNC command in PowerShell returns success, but Mediawiki installations reruns the same “Cannot access…” error.

Also I tried to use different ip address for access to MySql, but TNC command returns error for all ip adrees, and Mediawiki installation still returns “Cannot access…” error. TNC is success only for localhost -Port 3306.

Thank you in advance.


(Martin Terp) #2

Hi :slight_smile:

Instead of using “localhost” when defining the database host, try using the IP of the host.