Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Accessing Mysql database inside the container #592

Unanswered
creativehubspace asked this question in Q&A
Discussion options

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.

You must be logged in to vote

Replies: 2 comments 1 reply

Comment options

I have the same problem.

You must be logged in to vote
0 replies
Comment options

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.

You must be logged in to vote
1 reply
Comment options

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'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

AltStyle によって変換されたページ (->オリジナル) /