Python and SQLAlchemy error -pymysql.err.OperationalError(2006, “MySQL server has gone away …

After sitting for a few minutes and then attempting to reconnect to your database through the application (read, add, delete, or update functions) you receive the error: pymysql.err.OperationalError) (2006, “MySQL server has gone away (BrokenPipeError(32, ‘Broken pipe’) Insert the following app.config[‘SQLALCHEMY_ENGINE_OPTIONS’] = {“pool_pre_ping”: True, “pool_recycle”: 300,} https://medium.com/@heyjcmc/controlling-the-flask-sqlalchemy-engine-a0f8fae15b47   Insert the following into app.py, just after … Read more