Skip to content Skip to sidebar Skip to footer

Docker Error 2002 Sqlalchemy

Im currently working on a Flask Application with MySQL / SQLAlchemy. I am trying to dockerize it but it is having some trouble connecting to one of the sockets. I've looked at near

Solution 1:

According to the documentation, mysql is started with no database that can be used, unless you pass an environment variable.

Add this to the db section in your docker-compose file:

MYSQL_DATABASE: name-of-database

And the connection string should be:

'mysql://root:password@db/name-of-database'

Solution 2:

According to your docker-compose it something like this:

db_uri = 'mysql://root:password@db/[database]'

Post a Comment for "Docker Error 2002 Sqlalchemy"