Have a very odd occurrence with MariaDB Container (10.9 latest image) spun up using a docker-compose file.
The container all works, if I access the container's shell I can run mysql -u root -p and use my password to access mysql.
I patch port 3306 through to my M2 Mac and I get " Access Denied for root@'localhost' " when trying mysql -h 127.0.0.1 -u root -p and the same password.
If however I leave the password field blank, it connects. I'am at a loss why though! I thought it may be something like root@'%' having a blank pwd, but I have tried setting that to the same password. But either way I would expect the Access denied message to say I was using root@'%'
I have tried rebuilding the images, deleting the volumes. I found a github issue around the MYSQL_PWD being blank, so I have added that in for good measure, but it still doesn't play nicely.
db:
image: mariadb:latest
environment:
MYSQL_ROOT_PASSWORD: password
MYSQL_DATABASE: dev_db
MYSQL_USER: user
MYSQL_PASSWORD: password
MYSQL_PWD: password
ports:
- "3306:3306"
volumes:
- data-volume:/var/lib/mysql
Has anyone come across this before, or have any suggestions how to resolve it? It is like the root@'localhost' is somehow configured with two different credentials?