-
-
Notifications
You must be signed in to change notification settings - Fork 870
Accessing Mysql database inside the container #592
-
When I try to docker exec -it mysql-container mysql -uapp -p , I keep getting Access denied for user 'app'@'localhost' (using password: YES) . What am I missing?
Running docker compose exec php bin/console dbal:run-sql -q "SELECT 1" && echo "OK" || echo "Connection is not working" does echo "OK", so the database connection is working as expected.
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 2 comments 1 reply
-
I have the same problem.
Beta Was this translation helpful? Give feedback.
All reactions
-
I'm also facing the same issue with a psql database. My php container is connecting to it all fine but I am unable to connect to the db as a data source in PHPStorm or unable to connect to it from the database container.
Beta Was this translation helpful? Give feedback.
All reactions
-
old topic but had a similar issue and solved it by binding the ports on the compose.yaml
database:
image: mysql:${MYSQL_VERSION:-8}
platform: linux/amd64/v8
ports:
- '3306:3306'
Beta Was this translation helpful? Give feedback.