python - Using MySQL in Flask - Stack Overflow
https://stackoverflow.com/questions/984510222.03.2012 · Show activity on this post. Firstly you need to install Flask-MySQL package. Using pip for example: pip install flask-mysql. Next you need to add some configuration and initialize MySQL: from flask import Flask from flaskext.mysql import MySQL app = Flask (__name__) mysql = MySQL () app.config ['MYSQL_DATABASE_USER'] = 'root' app.config ['MYSQL ...