Mysql in docker container doesn't accept credentials
It is embarrassing to admit, but both commenters @RiggsFolly and @DavidMaze are right in what they said: I hadn't used MySQL for quite a while on my machine. When I checked the task manager, I indeed found a local mysqld running already, which of course was primed with different credentials. After killing the process (and adding the missing port in the compose file), I was able to connect to my containerized instance.
Hope this will help out somebody else in the future who falls into the same trap.

I have a Dockerfile which I later want to feed some initial sql dump into:
FROM mysql:debian

EXPOSE 3306

ENTRYPOINT ["docker-entrypoint.sh"]

CMD ["mysqld"]

Then there is my docker-compose.yaml:
version: '3'

services:
  mysql:
    container_name: ${CONTAINER_NAME}
    build:
      context: .
    restart: always
    environment:
      - MYSQL_ROOT_PASSWORD=${ROOT_PASSWORD}
      - MYSQL_USER=${MYSQL_USER}
      - MYSQL_PASSWORD=${MYSQL_PASSWORD}
      - MYSQL_DATABASE=${MYSQL_DATABASE}

I can docker exec -it sqlcontainer mysql -uroot -p into my container just fine (works with the $MYSQL_USER as well), but when I try to do the same from outside, e.g. with  mysql -uroot -p, I always get ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES).
I'm out of my wits. What am I doing wrong? The communication to mysqld inside the container apparently works, otherwise I wouldn't get back any response.
I'm on Windows, if that's a hint for anyone. But the above is true for PowerShell, CMD and even Git Bash.
