“MySQL server has gone away” with Ruby on Rails

后端 未结 11 1296
后悔当初
后悔当初 2020-12-12 19:09

After our Ruby on Rails application has run for a while, it starts throwing 500s with \"MySQL server has gone away\". Often this happens overnight. It\'s started doing this

11条回答
  •  失恋的感觉
    2020-12-12 20:02

    I had this problem when sending really large statements to MySQL. MySQL limits the size of statements and will close the connection if you go over the limit.

    set global max_allowed_packet = 1048576; # 2^20 bytes (1 MB) was enough in my case
    

提交回复
热议问题