9

I'm using laravel sail to launch a statamic website on my local machine (macOS). All packages are up-to-date and launch correctly however, the mysql service starts, then fails due to "another process with pid 62 is using unix socket file.".

I'm using the default sail docker-compose file, uneditted. It is working on my other, linux machine correctly with no issues. When visiting localhost, I'm met with "SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo for mysql failed: Name or service not known" which makes me think that it is connecting somehow as I would normally expect connection refused?

Here are the docker mysql container logs:

[Entrypoint] MySQL Docker Image 8.0.32-1.2.11-server
[Entrypoint] Starting MySQL 8.0.32-1.2.11-server
2023-01-26T21:17:04.876429Z 0 [Warning] [MY-011068] [Server] The syntax '--skip-host-cache' is deprecated and will be removed in a future release. Please use SET GLOBAL host_cache_size=0 instead.
2023-01-26T21:17:04.878708Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.32) starting as process 1
2023-01-26T21:17:04.885183Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2023-01-26T21:17:05.037353Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2023-01-26T21:17:05.189336Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2023-01-26T21:17:05.189362Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
2023-01-26T21:17:05.189506Z 0 [ERROR] [MY-010259] [Server] Another process with pid 62 is using unix socket file.
2023-01-26T21:17:05.189518Z 0 [ERROR] [MY-010268] [Server] Unable to setup unix socket lock file.
2023-01-26T21:17:05.189521Z 0 [ERROR] [MY-010119] [Server] Aborting
2023-01-26T21:17:06.724573Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.32)  MySQL Community Server - GPL.

Thanks in advance.

Polecalex
  • 323
  • 2
  • 12
  • 2
    Does this answer your question? [Docker db container running. Another process with pid is using unix socket file](https://stackoverflow.com/questions/36103721/docker-db-container-running-another-process-with-pid-id-is-using-unix-socket) – Pedro Rodrigues Jan 26 '23 at 21:34
  • Have a look at this one: https://stackoverflow.com/questions/36103721/docker-db-container-running-another-process-with-pid-id-is-using-unix-socket – Pedro Rodrigues Jan 26 '23 at 21:35
  • 1
    [MySql Server shut down immediately after docker-compose up](https://stackoverflow.com/questions/75242952/mysql-server-shut-down-immediately-after-docker-compose-up) asks an extremely similar question but doesn't have any conclusive diagnosis. Please see some of the details like the `docker-compose.yml` file that are in that question, and [edit] yours to include a [mcve] if it's not the same. – David Maze Jan 26 '23 at 22:20

4 Answers4

17

The solution that worked for me was - the answer (copied below)

Laravel Sail Mysql 8.0 problem on existing project

This was resolved by doing the following commands:

docker-compose down --volumes
sail up --build
Getafixx
  • 171
  • 3
4

I solve mine (WSL2, Docker Desktop) by opening the Docker Desktop GUI, opened the Volumes sidebar. Search for all volume that has "mysql" on their name and delete those volumes. Then run docker compose up again.

rsmn
  • 66
  • 3
1

The solution that worked for me is a a command from the answers above and the other one from my side.

docker-compose down --volumes and `sail up`
Nouman Khan
  • 153
  • 1
  • 1
  • 9
0

My Solution is run this command in your wsl ~/project/

 vendor/bin/sail down
Johny Knid
  • 11
  • 2
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community May 07 '23 at 19:27