I've been trying to figure out how to connect to a mariadb container while using podman-compose and I keep getting an error.
Here's what I've done:
Software Versions
podman version = 3.3.1
podman-compose version = podman-compose-0.1.7-2.git20201120.el8.noarch`
docker-compose.yml
version: '3'
services:
db:
image: mariadb:latest
environment:
MARIADB_USER: user
MARIADB_PASSWORD: pass
MARIADB_DATABASE: testdb
MARIADB_ROOT_PASSWORD: rootpass
volumes:
- db_data:/var/lib/mysql
When I spin this container up using: podman-compose up -d
Then try to connect to this database using:
podman exec -it project_db_1 mariadb -uroot -prootpass
I get this error:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
I get this error both as a regular user and as the root user.
Yet, when I run the same container with podman:
Podman Command
podman run -d \
--name mariadb \
-e MARIADB_USER=user \
-e MARIADB_PASSWORD=pass \
-e MARIADB_DATABASE=testdb \
-e MARIADB_ROOT_PASSWORD=rootpass \
mariadb:latest
Then try to connect to this database using:
podman exec -it mariadb mariadb -uroot -prootpass
I am able to successfully login.
Can anyone please explain to me what I'm doing wrong with podman-compose or why it's not allowing me to login with the credentials I've given?