Error starting userland proxy: listen tcp0.0.0.0: 3306: bind: address is already in use

Error: Unable to restart dockervel_mysql_1 container c258b418c03cbd6ec02c349c12cf09403f0eaf42fa9248019af7860d037d6474: driver does not connect external programming endpoint dockervel_mysql_1 (da3dd576458aa1fe3af7b539c48b9d61d97432cf5e9ee02d78562851f53981ae): E rror start userland proxy: listen tcp0.0.0.0: 3306: the bind: Address already in use.

I need to make an LAravel application and provide a Docker file, but I'm really stuck with this. Before that, I had a nightmare installing laravel on my machine.

I am trying to get an image of dockers and I follow the steps here: http://www.spiralout.eu/2015/12/dockervel-laravel-development.html

But when I run dartisan make: auth, it gives this error above.

I tried changing the default port in docker-compose.yml file

ports:

- "8084:80" 

still nothing, also tried stopping apache2 (service apache2 stop) on my machine, tried restarting the docker build and uninstalled docker container dockervel_mysql_1. I have to argue that I have one Laravel proj. in / var / www / laravel.

Please, help!

+9
source share
5 answers

You may already have a MySQL service running on port 3306. You should close it first.
Then try terminating docker-compose down and restarting it with docker-compose up .
Remember also to change permissions after adding a file to the project (e.g. dartisan make:auth ) with dpermit

UPDATE: since you changed the port to "8084", you should go to localhost:8084
If you see apache by default, you are probably looking at another server, since dockervel is based on nginx .
You probably also have some spaces in Docker. Do not mix local storage with docker storage. /var/www in the container is different from your local /var/www . in docker-compose.yml you mount the local ~/dockervel/www into the /var/www containers.
I would advise you to start all over again and revert the changes you made to the Apache server. Complete it, you do not need it. Dockervel will provide you with the NginX server in the container.

+8
source

I had the same problem and

 sudo netstat -nlpt |grep 3306 

showed me the PID and what service he started (mysgld). Whenever I tried to kill the PID, it started again. But the problem was fixed when I stopped the service

 sudo service mysql stop 

Note that you will need to use mysql , not mysqld .

I hope this does it for you - I was able to run docker-compose up without any problems

+13
source

on Ubuntu executing this command will stop your mysql for your docker container to work.

 sudo service mysqld stop 

Then, if your apache2 is running, you need to stop the service, especially when you want to work with nginx.

 sudo service apache2 stop 

Then you can run docker-compose up -d ...

+4
source

The error you see is the local mysql instance listening on port 3306 (currently on pid 1370 from your comments). You cannot start the container that is published on this host port while it is already in use by another process. Solutions should either stop mysql on the local host or change / delete the published port in your container. If the port is needed only by other containers, you can leave it unpublished, and they can directly communicate with a private docker network (by default, this is a "bridge").

+1
source

You need to change mysql port because you install mysql on your computer and it accepts default port 3306

and now you are trying to get dockervel_mysql_1 to work on the same port 3306, which is why you see in the error "Address already in use"

so if you change the dockervel_mysql_1 port to 3307, for example, it will work fine without stopping mysql running on your machine

0
source

All Articles