Under what circumstances would you want Rails to be set NOT to reconnect to MYSQL

前端 未结 2 1630
情歌与酒
情歌与酒 2021-02-13 09:13

I\'m experiencing a few errors on a rails app, along the lines of:

ActiveRecord::StatementInvalid: Mysql::Error: Lost connection to MySQL server during query: SE         


        
2条回答
  •  悲&欢浪女
    2021-02-13 09:42

    From the Rails 2.3 release notes (emphasis mine):

    4.8 Reconnecting MySQL Connections

    MySQL supports a reconnect flag in its connections – if set to true, then the client will try reconnecting to the server before giving up in case of a lost connection. You can now set reconnect = true for your MySQL connections in database.yml to get this behavior from a Rails application. The default is false, so the behavior of existing applications doesn’t change.

提交回复
热议问题