I have an app that allows users to register and log in. I can see the user details in the table after registration but when i try to log in it gives the following error.
raise errors.OperationalError("MySQL Connection not available.")
sqlalchemy.exc.OperationalError: (mysql.connector.errors.OperationalError) MySQL Connection not available.
It does not seem look like it is even connecting. This is what i have in my flask app, i removed the connection details but had previously entered in what I had in the databases tab. Any help will be appreciated as I am not sure how to proceed.
SQLALCHEMY_DATABASE_URI = "mysql+mysqlconnector://{username}:{password}@{hostname}/{databasename}".format(
username="",
password="",
hostname="",
databasename="",
)
app.config["SQLALCHEMY_DATABASE_URI"] = SQLALCHEMY_DATABASE_URI
app.config["SQLALCHEMY_POOL_RECYCLE"] = 280
app.config["SQLALCHEMY_TRACK_MODIFICATIONS"] = False
db = SQLAlchemy(app)
migrate = Migrate(app, db)