Forum: Ruby on Rails Mysql::Error: Lost connection to MySQL server during query

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
46fa933af973ed7e149737c9efecb429?d=identicon&s=25 Gary Huntress (Guest)
on 2006-01-19 03:22
(Received via mailing list)
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+Conn...  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
3f900b38ec3b2c45427c354722fa4ce3?d=identicon&s=25 Tom Fakes (tomfakes)
on 2006-01-19 03:28
(Received via mailing list)
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.
46fa933af973ed7e149737c9efecb429?d=identicon&s=25 Gary Huntress (Guest)
on 2006-01-19 03:40
(Received via mailing list)
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 Fakes" <tom@craz8.com>
To: <rails@lists.rubyonrails.org>
Sent: Wednesday, January 18, 2006 8:50 PM
Subject: RE: [Rails] Mysql::Error: Lost connection to MySQL server
during
query
3f900b38ec3b2c45427c354722fa4ce3?d=identicon&s=25 Tom Fakes (tomfakes)
on 2006-01-19 03:43
(Received via mailing list)
It's the WEBrick server code in Rails, so it is a Rails patch.
46fa933af973ed7e149737c9efecb429?d=identicon&s=25 Gary Huntress (Guest)
on 2006-01-19 03:52
(Received via mailing list)
Thanks to all that replied with suggestions.  Thanks to Tom Fakes 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 Huntress" <ghuntress@comcast.net>
To: <rails@lists.rubyonrails.org>
Sent: Wednesday, January 18, 2006 9:03 PM
Subject: Re: [Rails] Mysql::Error: Lost connection to MySQL server
during
query
This topic is locked and can not be replied to.