Docker - zsh: command not found: mysql

915 views Asked by At

I am running WordPress with wp-env and docker configuration, I want to connect to mysql via cli but I keep getting this error: zsh: command not found: mysql

I have tried: mysql -h 127.0.0.1:3308 -u root -p and in post 3306 as well

this is my docker-compose.yaml file

phpmyadmin works great

version: '3.1'

services:

  mysql:
    image: mysql:5.7
    ports:
      - 3308:3306
    environment:
      MYSQL_ROOT_PASSWORD: password
      MYSQL_DATABASE: wordpress_test
  phpmyadmin:
    depends_on:
      - mysql
    image: phpmyadmin/phpmyadmin
    container_name: phpmyadmin
    restart: always
    ports:
      - '8080:80'
    environment:
      PMA_HOST: mysql
volumes:
  testsuite:
`
1

There are 1 answers

0
DavSev On

What I did was to execute the following command:

docker exec -it {container name} bash -l