I'm configuring a docker compose file, and the first step is to configure the MySQL service (so I can further use in my app service), but no matter what, I cannot enter MySQL within the container, even when I set all environments. That's how my docker-compose.yml file looks like:
version: "3.3"
services:
db:
image: mysql:5.7
volumes:
- ./tmp/db:/var/lib/mysql
restart: always
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: wordpress
MYSQL_USER: wordpress
MYSQL_PASSWORD: wordpress
I've tried SEVERAL (I literally lost count of how many) other configurations, and none of them work, it just doesn't work.
If I go inside the container with docker exec it ${CONTAINER_NUMBER} bash
and try to access MySQL, it will ALWAYS return:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
Or if I try with the user wordpress:
ERROR 1045 (28000): Access denied for user 'wordpress'@'localhost' (using password: YES)
I'm pretty confident that I spent more than 8 hours only changing the configuration, so the only thing I can think right now is: the image is broken.
I'm in a Ubuntu 19, not sure if this makes any difference.