Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

enadabuzaid's avatar

I have problem when istalled sail

I installed sail on existing project everything is okay but wen run sail up -d

the mysql image stopped after three or four second and this logs for the image

2023-10-23 11:36:45 [Entrypoint] MySQL Docker Image 8.0.32-1.2.11-server
2023-10-23 11:36:45 [Entrypoint] Starting MySQL 8.0.32-1.2.11-server
2023-10-23 11:36:45 2023-10-23T08:36:45.887725Z 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-10-23 11:36:45 2023-10-23T08:36:45.889533Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.32) starting as process 1
2023-10-23 11:36:45 2023-10-23T08:36:45.895840Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2023-10-23 11:36:46 2023-10-23T08:36:46.017419Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2023-10-23 11:36:46 2023-10-23T08:36:46.114473Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2023-10-23 11:36:46 2023-10-23T08:36:46.114496Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
2023-10-23 11:36:46 2023-10-23T08:36:46.114719Z 0 [ERROR] [MY-010259] [Server] Another process with pid 62 is using unix socket file.
2023-10-23 11:36:46 2023-10-23T08:36:46.114731Z 0 [ERROR] [MY-010268] [Server] Unable to setup unix socket lock file.
2023-10-23 11:36:46 2023-10-23T08:36:46.114735Z 0 [ERROR] [MY-010119] [Server] Aborting
2023-10-23 11:36:47 2023-10-23T08:36:47.674187Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.32)  MySQL Community Server - GPL.

when run docker ps -a I get this and existed for the status

b7583851849c   sail-8.2/app             "start-container"        4 minutes ago   Up 4 minutes               0.0.0.0:80->80/tcp, 0.0.0.0:5173->5173/tcp, 8000/tcp   security-circles-laravel.test-1
cfddc513ce56   mysql/mysql-server:8.0   "/entrypoint.sh mysq…"   4 minutes ago   Exited (1) 4 minutes ago    

Note: I run the sail on the many projects all of these projects are work and everything okay

0 likes
8 replies
LaryAI's avatar
Level 58

Based on the logs and the output of docker ps -a, it seems that the MySQL container is exiting with an error. The error message "Another process with pid 62 is using unix socket file" suggests that there might be another process already using the socket file that MySQL is trying to use.

To resolve this issue, you can try the following steps:

  1. Stop and remove the existing MySQL container:

    docker stop <container_id>
    docker rm <container_id>
    
  2. Check if there are any other processes using the socket file:

    sudo lsof /var/run/mysqld/mysqld.sock
    

    If there are any processes listed, you can kill them using their PID:

    sudo kill <pid>
    
  3. Start the MySQL container again using Sail:

    sail up -d
    

If the issue persists, you can try the following additional steps:

  1. Stop and remove the existing MySQL container:

    docker stop <container_id>
    docker rm <container_id>
    
  2. Remove the socket file:

    sudo rm /var/run/mysqld/mysqld.sock
    
  3. Start the MySQL container again using Sail:

    sail up -d
    

If none of the above solutions work, you can try restarting your machine and then running sail up -d again.

Note: Make sure to replace <container_id> with the actual ID of the MySQL container obtained from the output of docker ps -a.

enadabuzaid's avatar

@LaryAI when remove the : sudo rm /var/run/mysqld/mysqld.sock

I get this rm: /var/run/mysqld/mysqld.sock: No such file or directory

MAntoniusz's avatar

@enadabuzaid Locate docker volume (in my case it was called {projectname}-sail-mysql), attach to it and delete mysql.sock and mysql.sock.lock files.

1 like
muindetuva's avatar

simpler solution I have found is to run: docker-compose down --volumes or docker compose down --volumes then sail up --build

3 likes
marcoscoe's avatar

If you are using Docker Desktop:

Run "sail stop" in your terminal.

On Docker Desktop: Navigate to the menu and select "Volumes". Click on your MySQL volume. Locate a file named "mysql.sock.lock" and delete it. Return to your terminal and execute "sail up -d".

I resolved it this way.

3 likes
JonathanAspeling's avatar

@marcoscoe Worked wonders - deleted the volume and relaunched still gave me issues but the moment I dropped that mysql.sock.lock All was well <3

Please or to participate in this conversation.