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

Earlier I posted a question about password hashes because I thought that
was
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)
on
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
http://wiki.rubyonrails.com/rails/pages/Mysql+Connection+Problems/ I am
using webrick on FC4. But the puzzling thing to me is that this has
been
running for weeks with no problems. gem install mysql fails but I
can’t
use the method provided at http://www.ocsforums.com/showthread.php?t=132
because it fails with can’t find header files for ruby.

Has anyone else had MySQL “Lost Connection” problems?

Gary

This patch may fix your problem: http://dev.rubyonrails.org/ticket/3433

Does your log file look like two requests are running at the same time?
If
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
applied
to WEBrick right? not Rails?

Gary
----- 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
during
query

Thanks to all that replied with suggestions. Thanks to Tom F. for
suggesting a patch. I ended up basically following the directions here
http://www.ocsforums.com/showthread.php?t=132 and I was able to install
the
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
been
in operation for weeks. But whatever, I’m back in business!

Gary
----- 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
during
query

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