Connecting local MySQL database inside a Docker container?



Here is how I am trying to connect. But it shows:

Host ‘host.docker.internal’ is not allowed to connect


       - MYSQL_DSN=mysql:host=;port=3307;dbname=dbname


Your MySQL user does not allow external connections.

Update your user to allow external connections using "GRANT" or create a new user using "CREATE USER":

To accept all connections, use % wildcard as a host part.

Answered By – Camille

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave A Reply

Your email address will not be published.

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More