Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Docker using mysql

Tags:

docker

Get following error, when trying to run MySQL in docker. Saying the ports is already in use, that would be for my local mysql database perhaps, how do I use docker and mysql

 docker: Error response from daemon: driver failed programming external     connectivity on endpoint stupefied_einstein (): Error starting userland proxy: listen tcp 0.0.0.0:3306: bind: address already in use.
like image 642
GAV Avatar asked Aug 07 '26 06:08

GAV


1 Answers

Map you docker mysql container on another port when you start the container:

docker run -p 3307:3306 ...

The container port 3306 will be mapped on the host port 3307. (while your real mysql can use 3306)

like image 141
lvthillo Avatar answered Aug 09 '26 22:08

lvthillo



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!