In trying to connect to connect to mysql using docker but I get the following logs below. How do I resolve this?
db_1 | Version: '5.7.34' socket: '/var/run/mysqld/mysqld.sock' port: 3307 MySQL Community Server (GPL)
db_1 | 2021-05-26T17:02:40.191347Z 2 [Note] Access denied for user 'admin'@'172.27.0.3' (using password: YES)
db_1 | 2021-05-26T17:02:40.259636Z 3 [Note] Access denied for user 'admin'@'172.27.0.3' (using password: YES)
db_1 | 2021-05-26T17:02:40.275977Z 4 [Note] Access denied for user 'admin'@'172.27.0.3' (using password: YES)
db_1 | 2021-05-26T17:02:40.361165Z 5 [Note] Access denied for user 'admin'@'172.27.0.3' (using password: YES)
db_1 | 2021-05-26T17:02:40.366075Z 6 [Note] Access denied for user 'admin'@'172.27.0.3' (using password: YES)
db_1 | 2021-05-26T17:02:40.367748Z 7 [Note] Access denied for user 'admin'@'172.27.0.3' (using password: YES)
db_1 | 2021-05-26T17:02:40.370714Z 8 [Note] Access denied for user 'admin'@'172.27.0.3' (using password: YES)
db_1 | 2021-05-26T17:02:40.372608Z 9 [Note] Access denied for user 'admin'@'172.27.0.3' (using password: YES)
db_1 | 2021-05-26T17:02:40.402829Z 10 [Note] Access denied for user 'admin'@'172.27.0.3' (using password: YES)
db_1 | 2021-05-26T17:05:14.885240Z 11 [Note] Access denied for user 'root'@'localhost' (using password: NO)
Docker Compose File
version: '3'
services:
# redis:
# restart: always
# image: redis:latest
# expose:
# - "6379"
db:
image: mysql:5.7
command: --default-authentication-plugin=mysql_native_password
restart: always
environment:
MYSQL_DATABASE: default_schema
MYSQL_USER: admin
MYSQL_PASSWORD: test
MYSQL_ROOT_PASSWORD: *asus@2837
MYSQL_TCP_PORT: 3307
# volumes:
# - .dbdata:/var/lib/mysql
ports:
- 3307:3307
appseed-app:
restart: always
# env_file: .env
command: gunicorn --bind 0.0.0.0:5006 core.wsgi:application
build: ./app
ports:
- "5006:5006"
# networks:
# - web_network
# links:
# - redis
depends_on:
- db
# - worker
volumes:
# - /path/source/on/host:/path/destination/on/container
- ./static/:/app/static
- ./db.sqlite3:/app/db.sqlite3"
# phpmyadmin:
# image: phpmyadmin/phpmyadmin
# container_name: pma
# links:
# - db
# environment:
# PMA_HOST: db
# PMA_PORT: 3307
# PMA_ARBITRARY: 1
# restart: always
# ports:
# - 8083:86
nginx:
restart: always
image: "nginx:latest"
ports:
- "86:86"
volumes:
- ./app/nginx:/etc/nginx/conf.d
- ./app/static/:/static
# networks:
# - web_network
depends_on:
- appseed-app
# Celery worker
# worker:
# build: ./app
# command: sh ./run_celery.sh
# links:
# - redis
# flower:
# image: mher/flower
# environment:
# - CELERY_BROKER_URL=redis://redis:6379/0
# - FLOWER_PORT=8888
# ports:
# - 8888:8888
# networks:
# web_network:
# driver: bridge
settings.py
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'default_schema',
"USER": 'admin',
"PASSWORD": "test",
'HOST': 'db',
'PORT': '3307',
}
}