Error 2006: “MySQL server has gone away” using Python, Bottle Microframework and Apache

前端 未结 4 1813
清酒与你
清酒与你 2021-01-01 00:18

After accessing my web app using:
- Python 2.7
- the Bottle micro framework v. 0.10.6
- Apache 2.2.22
- mod_wsgi
- on Ubuntu Server 12.04 64bit

4条回答
  •  独厮守ぢ
    2021-01-01 00:44

    For me this was fixed using

    MySQLdb.connect("127.0.0.1","root","","db" )
    

    instead of

    MySQLdb.connect("localhost","root","","db" )
    

    and then

    df.to_sql('df',sql_cnxn,flavor='mysql',if_exists='replace', chunksize=100)
    

提交回复
热议问题