Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ActiveRecord::StatementInvalid: Mysql2::Error: Lost connection to MySQL server during query: SHOW TABLES LIKE 'users' #421

mohitnegi opened this issue Sep 19, 2013 · 4 comments


Copy link

@mohitnegi mohitnegi commented Sep 19, 2013

I'm using mysql2 0.3.13, rails 3.2.14, ruby 1.9.3p448 (2013-06-27 revision 41675) [x86_64-linux] .. and I'm getting this problem intermittently on production. Any suggestions? My wait_timeout in mysql is set to 28800.

Copy link

@sodabrew sodabrew commented Nov 20, 2013

What was the previous query? Your connection may have timed out before starting this query. Any other timeout values that are set low? Is reconnect enabled or disabled?

Copy link

@brianmario brianmario commented Jan 25, 2014

Sounds related to

Copy link

@WilliamDenniss WilliamDenniss commented Mar 15, 2014

By any chance have you set the reaping_frequency ActiveRecord config? I found that the ActiveRecord connection reaper was causing this error. It's disabled by default in rails (for good reason it seems), but some some samples out there recommend enabling it (such as from Heroku).

See this issue from Rails rails/rails#9907 and my SO answer on this topic:

Copy link

@sodabrew sodabrew commented Apr 7, 2014

Closing per @WilliamDenniss blog post explaining the bad news reaping_frequency option. And lack of updates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet

No branches or pull requests

4 participants