Hello,
Im now trying to connect to mysql DB but i get this error
ERROR 1045 (28000): Access denied for user ‘magento’@‘localhost’ (using password: YES)
I dont know what or where the problem is
this is the docker-compose I made
version: '2'
services:
mysql:
image: 'mysql:8.0.22'
container_name: mysql
environment:
- MYSQL_DATABASE= magentodb
- MYSQL_ROOT_PASSWORD= my-secret-pw
- MYSQL_USER= magento
- MYSQL_PASSWORD= my-secret-pw
ports:
- '3306:3306'
volumes:
- mysql-vol:/var/lib/mysql
elasticsearch:
image: 'elasticsearch:7.10.1'
container_name: elasticsearch
environment:
- node.name=elasticsearch
- discovery.type=single-node
- bootstrap.memory_lock=true
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
ulimits:
memlock:
soft: -1
hard: -1
volumes:
- elasticsearch-vol:/usr/share/elasticsearch/data
ports:
- '9200:9200'
magento:
build: .
container_name: magento
ports:
- '80:80'
- '443:443'
depends_on:
- mysql
- elasticsearch
volumes:
elasticsearch-vol:
driver: local
mysql-vol:
driver: local
my question is, why I cant connect to mysql while I defined the mysql user and password as env. variables when creating the container?