Forums

"MySQL server has gone away" , flask, pandas.read_sql("select ....",con=db.engine)

i get error "MySQL server has gone away" from time to time. when trying to read from mysql database with pandas.read_sql("select ....",con=db.engine)

according to forum i do set pool sqlalchemy variable:

app.config['SQLALCHEMY_POOL_SIZE']=100

what is the best solution for this?

thanks

i think this is solved by app.config['SQLALCHEMY_POOL_RECYCLE']=280

Yes, the last of those is the correct setting. The pool size probably won't have any effect -- it's probably best left as the default setting.