brad
2006-Jan-12 20:37 UTC
[Rails] Mysql::Error: Lost connection to MySQL server during query
I have been very VERY frustrated for the past week trying to solve a seemingly spurious problem with my Windows XP SP2 box with Ruby 1.8.2/Rails 1.0.0/MySQL 5.0.16 or 4.1.15 (yes, I tried both) installed running against a remote MySQL server that was either 3.23 or 4.1 (4.1.15 to be exact--we finally matched them both up to make sure that wasn''t the problem). So I post it here (as well as in the Rails_Engine forum, where it first arose for me), in the hopes that it will save someone else some significant trouble. Just for the record, in case others have this problem, what I did was download a compresssed .RAR file for mysql 4.1.15 (mysql-ruby-win32.rar) and copied the mysql.so file to the location specified in the readme at this link: http://jeroen.concept-q.biz/files/ This did the trick... I''ve spent more than 3 days pulling my hair out (as well as my business partner who''s also lost some hair as well--plus he hates it when I pull his hair ;-), but didn''t discover this link until just now. Thanks Colin!! (original source: http://weblog.rubyonrails.com/articles/2005/10/30/get-10-15-more-performance-with-mysql-rails thread # 29. Which, unfortunately, I can''t post to, in order to help others who may have this same problem.) EVERYONE: If you are getting ANY kind of MySQL::Error, in particular what I was getting was variations of this: Mysql::Error: Lost connection to MySQL server during query [ . . . ] (Buried deep in a stack trace from Rails--this wasn''t occuring for a local instance of MySQL server, but only when it was running on a remote server--in our case on a 1&1 dedicated--I think Fedora--host that we self-manage. Of course the adapter worked fine from the server itself AND it worked fine from a Mac OS X box running the identical Ruby/Rails/login_engine code against this remote MySQL server, but always got the error above when running from my Windows XP SP 2 box.) Anyway, if you have this problem, try going to the above URL and download the .RAR file there (you may need to download WinACE or something similar to read .rar compressed files), then read the readme.txt located within and copy the file where it directs. Good luck! ~ Brad -- Posted via http://www.ruby-forum.com/.
Tom Fakes
2006-Jan-12 20:53 UTC
[Rails] Mysql::Error: Lost connection to MySQL server during query
There is a bug with WEBrick that will cause MySQL errors to be displayed. The ticket contains the problem, and the fix: http://dev.rubyonrails.org/ticket/3433 Since this bug is timing related, changing drivers, running on a different platform, or running MySQL over the net could also cause it to appear or disappear. If you''re not running WEBrick, you won''t see the problem in the ticket. -----Original Message----- From: rails-bounces@lists.rubyonrails.org [mailto:rails-bounces@lists.rubyonrails.org] On Behalf Of brad Sent: Thursday, January 12, 2006 12:38 PM To: rails@lists.rubyonrails.org Subject: [Rails] Mysql::Error: Lost connection to MySQL server during query I have been very VERY frustrated for the past week trying to solve a seemingly spurious problem with my Windows XP SP2 box with Ruby 1.8.2/Rails 1.0.0/MySQL 5.0.16 or 4.1.15 (yes, I tried both) installed running against a remote MySQL server that was either 3.23 or 4.1 (4.1.15 to be exact--we finally matched them both up to make sure that wasn''t the problem). So I post it here (as well as in the Rails_Engine forum, where it first arose for me), in the hopes that it will save someone else some significant trouble. Just for the record, in case others have this problem, what I did was download a compresssed .RAR file for mysql 4.1.15 (mysql-ruby-win32.rar) and copied the mysql.so file to the location specified in the readme at this link: http://jeroen.concept-q.biz/files/ This did the trick... I''ve spent more than 3 days pulling my hair out (as well as my business partner who''s also lost some hair as well--plus he hates it when I pull his hair ;-), but didn''t discover this link until just now. Thanks Colin!! (original source: http://weblog.rubyonrails.com/articles/2005/10/30/get-10-15-more-performance -with-mysql-rails thread # 29. Which, unfortunately, I can''t post to, in order to help others who may have this same problem.) EVERYONE: If you are getting ANY kind of MySQL::Error, in particular what I was getting was variations of this: Mysql::Error: Lost connection to MySQL server during query [ . . . ] (Buried deep in a stack trace from Rails--this wasn''t occuring for a local instance of MySQL server, but only when it was running on a remote server--in our case on a 1&1 dedicated--I think Fedora--host that we self-manage. Of course the adapter worked fine from the server itself AND it worked fine from a Mac OS X box running the identical Ruby/Rails/login_engine code against this remote MySQL server, but always got the error above when running from my Windows XP SP 2 box.) Anyway, if you have this problem, try going to the above URL and download the .RAR file there (you may need to download WinACE or something similar to read .rar compressed files), then read the readme.txt located within and copy the file where it directs. Good luck! ~ Brad -- Posted via http://www.ruby-forum.com/. _______________________________________________ Rails mailing list Rails@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails
Gary Huntress
2006-Jan-19 01:45 UTC
[Rails] 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
Tom Fakes
2006-Jan-19 01:49 UTC
[Rails] Mysql::Error: Lost connection to MySQL server during query
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. -----Original Message----- From: rails-bounces@lists.rubyonrails.org [mailto:rails-bounces@lists.rubyonrails.org] On Behalf Of Gary Huntress Sent: Wednesday, January 18, 2006 5:45 PM To: rails@lists.rubyonrails.org Subject: [Rails] 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 _______________________________________________ Rails mailing list Rails@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails
Gary Huntress
2006-Jan-19 02:03 UTC
[Rails] Mysql::Error: Lost connection to MySQL server during query
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> 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. > > -----Original Message----- > From: rails-bounces@lists.rubyonrails.org > [mailto:rails-bounces@lists.rubyonrails.org] On Behalf Of Gary Huntress > Sent: Wednesday, January 18, 2006 5:45 PM > To: rails@lists.rubyonrails.org > Subject: [Rails] 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 > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
Tom Fakes
2006-Jan-19 02:06 UTC
[Rails] Mysql::Error: Lost connection to MySQL server during query
It''s the WEBrick server code in Rails, so it is a Rails patch. -----Original Message----- From: rails-bounces@lists.rubyonrails.org [mailto:rails-bounces@lists.rubyonrails.org] On Behalf Of Gary Huntress Sent: Wednesday, January 18, 2006 6:03 PM To: rails@lists.rubyonrails.org Subject: Re: [Rails] Mysql::Error: Lost connection to MySQL server during query 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> 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. > > -----Original Message----- > From: rails-bounces@lists.rubyonrails.org > [mailto:rails-bounces@lists.rubyonrails.org] On Behalf Of Gary Huntress > Sent: Wednesday, January 18, 2006 5:45 PM > To: rails@lists.rubyonrails.org > Subject: [Rails] 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 > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >_______________________________________________ Rails mailing list Rails@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails
Gary Huntress
2006-Jan-19 02:14 UTC
SOLUTION Re: [Rails] Mysql::Error: Lost connection to MySQL server during query
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> 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 > > >> 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. >> >> -----Original Message----- >> From: rails-bounces@lists.rubyonrails.org >> [mailto:rails-bounces@lists.rubyonrails.org] On Behalf Of Gary Huntress >> Sent: Wednesday, January 18, 2006 5:45 PM >> To: rails@lists.rubyonrails.org >> Subject: [Rails] 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 >> >> >> _______________________________________________ >> Rails mailing list >> Rails@lists.rubyonrails.org >> http://lists.rubyonrails.org/mailman/listinfo/rails >> >> _______________________________________________ >> Rails mailing list >> Rails@lists.rubyonrails.org >> http://lists.rubyonrails.org/mailman/listinfo/rails >> > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >