Skip to content
Advertisement

Python Flask-Mysql KeyError: ‘MYSQL_HOST’

I am building a python flask-Mysql app. I am building it using AWS cloud9. But When I run the code I am geting MYSQL_HOST key error. I am attaching code below. Is it because of the installation fault or code error.?`

JavaScript

`

Advertisement

Answer

You are calling application = Flask(__name__) twice. So second time you are overwriting the first application. It should be:

JavaScript
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement