not able to connect mysql from sequel or terminal

432 Views Asked by At

I'm using mysql in docker. I can access docker through docker exec terminal. But I can't access it outside through my regular terminal or sequel ace.

What I'm getting in in sequel ace and in regular terminal

Access denied

Unable to connect to host 127.0.0.1 because access was denied.

Double-check your username and password and ensure that access from your current location is permitted.

MySQL said: Access denied for user 'crowdtank'@'localhost' (using password: YES) Access denied for user 'crowdtank'@'localhost' (using password: YES)

Terminal command and output for access attempt ERROR 1045 (28000): Access denied for user 'crowdtank'@'localhost' (using password: YES)

My docker code

version: '3'

networks:
  laravel:

services:
  nginx:
    image: nginx:stable-alpine
    container_name: nginx
    ports:
      - "8080:80"
    volumes:
      - ./src:/var/www
      - ./nginx/default.conf:/etc/nginx/conf.d/default.conf
    depends_on:
      - php
      - mysql
    networks:
     - laravel

  mysql:
    image: mysql:5.7.22
    container_name: mysql
    restart: unless-stopped
    tty: true
    ports: 
      - "3306:3306"
    volumes:
      - ./mysql:/var/lib/mysql
    environment:
      MYSQL_DATABASE: crowdtank
      MYSQL_USER: crowdtank
      MYSQL_PASSWORD: crowdtank
      MYSQL_ROOT_PASSWORD: crowdtank
      SERVICE_TAGS: dev
      SERVICE_NAME: mysql
    networks:
      - laravel

  php:
    build:
      context: .
      dockerfile: Dockerfile
    container_name: php
    volumes:
      - ./src:/var/www
    ports:
      - "9000:9000"
    networks:
      - laravel
0

There are 0 best solutions below