Hello,
I’m trying to run apache, php and mysql.
And I can’t connect to mysql with MYSQL_USER and MYSQL_PASSWORD parameters i defined on docker-compose file.
This is my docker-compose.yml file :
version: '3.2'
services:
apache:
container_name: apache
build: .docker/apache/
restart: always
volumes:
- .:/var/www/html/app/
ports:
- 80:80
depends_on:
- php
- mysql
links:
- mysql:mysql
php:
container_name: php
build: .docker/php/
restart: always
volumes:
- .:/var/www/html/app/
working_dir: /var/www/html/app/
mysql:
container_name: mysql
image: mysql
restart: always
volumes:
- .docker/data/db:/var/lib/mysql
environment:
MYSQL_DATABASE: app
MYSQL_ROOT_PASSWORD: test
MYSQL_USER: test
MYSQL_PASSWORD: test
When i try to run the command under mysql container : mysql -utest -ptest
I have access denied, but i’m only able to connect with mysql -uroot -proot
Help me please.
Thanks.