Mysql::Error: Lost connection to MySQL server during query

Earlier I posted a question about password hashes because I thought that
the last thing in my app that I touched (mysql GRANTs) but after poking
through my logs I am now not so sure it is the password.

In my log I see:

ActionView::TemplateError (Mysql::Error: Lost connection to MySQL server
during query: SELECT * FROM newsitems ORDER BY created DESC LIMIT 4)
line #84 of app/views/layouts/application.rhtml:

It now seems to me that I do log in ok and that what I thought was a
password problem was a red herring.

This seems to be a known problem on some platforms I am
using webrick on FC4. But the puzzling thing to me is that this has
running for weeks with no problems. gem install mysql fails but I
use the method provided at
because it fails with can’t find header files for ruby.

Has anyone else had MySQL “Lost Connection” problems?


This patch may fix your problem:

Does your log file look like two requests are running at the same time?
so, the above patch should fix that.

It’s the WEBrick server code in Rails, so it is a Rails patch.

No it does not appear to be issuing two requests, according to my log.

Thx for the suggestion though. I may still try your patch. It is
to WEBrick right? not Rails?

----- Original Message -----
From: “Tom F.” [email protected]
To: [email protected]
Sent: Wednesday, January 18, 2006 8:50 PM
Subject: RE: [Rails] Mysql::Error: Lost connection to MySQL server

Thanks to all that replied with suggestions. Thanks to Tom F. for
suggesting a patch. I ended up basically following the directions here and I was able to install
mysql gem. However I did not need to make the change from
i386-redhat-linux-gcc to i386-redhat-linux-gcc32. I just compiled it
locally and installed it again.

I’m still unclear why this broke in the first place, as I said it had
in operation for weeks. But whatever, I’m back in business!

----- Original Message -----
From: “Gary H.” [email protected]
To: [email protected]
Sent: Wednesday, January 18, 2006 9:03 PM
Subject: Re: [Rails] Mysql::Error: Lost connection to MySQL server

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs