0

I am new to using PHPMyAdmin in docker, and so I was able to get the containers for MySQL and for PHPMyAdmin running, but after restarting my computer, both containers exited.

I tried running docker-compose up -d again in the directory containing my dockerfile but I get these errors:

Error starting userland proxy: listen tcp 0.0.0.0:3306: bind: address already in use

Error starting userland proxy: listen tcp 0.0.0.0:8080: bind: address already in use

Following this, I tried running docker-compose down which removes the two containers, but docker-compose up is still not able to restart the two containers due to these errors.

I also tried calling sudo kill -9 PID on the MySQL process running on port 3306 but each time I call it, there remains a process running on that port.

The third thing I tried is docker-compose rm and removing these containers before running docker-compose up -d again, as well as docker-compose restart, but I still run into this error.

Is there a proper way of restarting the containers I am using? Or am I misunderstanding the standard for running docker containers?

EDIT: This is my docker-compose.yaml:

version: "3.7"
services:
  mysql-server:
    image: mysql:8.0.19
    restart: always
    environment:
      MYSQL_ROOT_PASSWORD: secret
    volumes:
      - mysql-data:/var/lib/mysql
    ports:
      - "3306:3306"
   
  phpmyadmin:
    image: phpmyadmin/phpmyadmin:5.0.1
    restart: always
    environment:
      PMA_HOST: mysql-server
      PMA_USER: root
      PMA_PASSWORD: secret
    ports:
      - "8080:80"
volumes:
  mysql-data:
Deepak Kumar
  • 1,246
  • 14
  • 38
Anonymous
  • 93
  • 8
  • Can you try running `docker-compose down` in your project directory and try this again? – kabirbaidhya Aug 13 '20 at 03:35
  • I have tried that and still I get these errors. – Anonymous Aug 13 '20 at 03:42
  • That error means "something else on the host is already using this port". That could be another Docker setup or a MySQL installation running directly on the host. You can change the _first_ number of `ports:` to pick a different host port (leave the second number the same). [Docker Error bind: address already in use](https://stackoverflow.com/questions/37971961/docker-error-bind-address-already-in-use) has some other debugging tips. – David Maze Aug 13 '20 at 11:13

0 Answers0