SQLAlchemy error MySQL server has gone away

前端 未结 6 2088
清酒与你
清酒与你 2021-02-05 07:58

Error OperationalError: (OperationalError) (2006, \'MySQL server has gone away\') i\'m already received this error when i coded project on Flask, but i cant underst

6条回答
  •  清酒与你
    2021-02-05 08:28

    from documentation you can use pool_recycle parameter:

    from sqlalchemy import create_engine
    e = create_engine("mysql://scott:tiger@localhost/test", pool_recycle=3600)
    

提交回复
热议问题