title: Cannot connect to MYSQL using SQLAlchemy
body: <p>I am not able to connect to my mysql. I am using pymysql for connecting to Mysql.</p>
  
  <p>Here is my code in Flask:</p>
  
  <pre><code>app.config["SQLALCHEMY_DATABASE_URI"] = "mysql+pymysql://"+config.get_config("MYSQL_DATABASE_USER")+":"\
                                          + config.get_config("MYSQL_DATABASE_PASSWORD")+"@"\
                                          + config.get_config("SERVER_HOST_NAME")+":"\
                                          + config.get_config("MYSQL_DATABASE_PORT")+"/"\
                                          + config.get_config("MYSQL_DATABASE_DB")
  </code></pre>
  
  <p>And this is my docker-compose file </p>
  
  <pre><code>version: "3"
  services:
    db:
      build: ./db
      restart: always
      ports:
        - "3308:3306"
      environment:
        - MYSQL_USER=root
        - MYSQL_ROOT_PASSWORD=root@123
    flask:
      build: ./python-backend
      links:
        - db
      depends_on:
        - db
      ports: 
        - "7000:7000"
    angular:
      build: ./angular-template
      depends_on:
        - flask
      ports:
        - "4200:4200"
  </code></pre>
  
  <p>When I am hitting a route this says </p>
  
  <pre><code>"(pymysql.err.OperationalError) (2003, \"Can't connect to MySQL server on '0.0.0.0' ([Errno 111] Connection refused)\")\n(Background on this error at: http://sqlalche.me/e/e3q8)"
  </code></pre>
  
  <p>Any clue on what I am doing wrong here?</p>
  
  <p>And here is my config file</p>
  
  <pre><code>"SERVER_SECRET":"winter is coming",
              "MYSQL_DATABASE_USER": "root",
              "MYSQL_DATABASE_PASSWORD": "root@123",
              "MYSQL_DATABASE_DB": "template",
              "MYSQL_DATABASE_HOST": "172.17.0.1", #localhost
              "MYSQL_DATABASE_CHARSET": "utf-8",
              "MYSQL_DATABASE_PORT": "3306",
              "SERVER_HOST_NAME": "0.0.0.0", #localhost
              "SERVER_PORT": 7000,
              "SERVER_DEBUG": True
  </code></pre>