Recurring mySQL Error

I am getting the following error when running my app on the server:
mysql::Error: Lost connection to MySQL server during query:

The SQL is usually a SHOW FIELDS statement, but after scouring the log
files I see that it occassionally happens with other queries as well.

I did a little research, and one topic I found suggested that I edit the
/etc/mysql/my.cnf and increase the timeout period. I checked and I am
using the default timeout which is probably too long.

This problem seemed to start happening when I started storing my
sessions in a table, but I can pin it down to exactly that.

Anyone have any ideas? I’m completely stumped on this one.

Joe C. wrote:

I am getting the following error when running my app on the server:
mysql::Error: Lost connection to MySQL server during query:

The SQL is usually a SHOW FIELDS statement, but after scouring the log
files I see that it occassionally happens with other queries as well.

I did a little research, and one topic I found suggested that I edit the
/etc/mysql/my.cnf and increase the timeout period. I checked and I am
using the default timeout which is probably too long.

This problem seemed to start happening when I started storing my
sessions in a table, but I can pin it down to exactly that.

Anyone have any ideas? I’m completely stumped on this one.

Ok it seems to be the sessions. I commented this line out from the
environment.rb:
config.action_controller.session_store = :active_record_store

Once I did that the database errors halted immediately. The machine is
a P4 2.8, with 1gb ram, and I was the only one using the boxs so I doubt
it would be load. This sounds like my set up between ruby and mysql
needs some tweaking.

Not being a ruby, mysql, or linux expert I’m not sure exactly what to
tweak. Anyone have any useful places to start looking?

Joe,
I had the same problem. The problem was with different versions of
MySQL+Ruby. I compile mysql.so for mysql4.1 on winXP and than it worked.
See if you have latest versions for both ruby and mmysql.

Ruby R. wrote:

Joe,
I had the same problem. The problem was with different versions of
MySQL+Ruby. I compile mysql.so for mysql4.1 on winXP and than it worked.
See if you have latest versions for both ruby and mmysql.

Hi thanks for the advice! I looked deeply into what version of mysql I
had running and it was the relatively ancient 4.0.24 which is what is
what debian has as their stable package.

My bad for not checking from the get-go. I’ll get the latest mysql
source tonight and do a compile and install of that. Had to do the
same thing for ruby 1.8.4 as the stable debian package only was up to
1.8.2

Those deb packagers are not a particularly fast moving lot are they?

Hi,
Another option is to install InstantRails. This includes recent
installs of MySQL (Not 5 though) and Appache and the whole package
installs and runs in about 5 minutes on a standard WinXP machine.

The out of the box sample applications rely on the Root user on 

MySQL
to have no password which is the MySQL installation by default. As a
result there are a couple of extra steps to secure MySQL but they do
run out of the box which is really cool.

Mat

I’m using InstantRails and I’m seeing the same recurring MySQL error.

I’ve just switched off saving the sessions in the database to see if
that
helps.

----- Original Message -----
From: [email protected]
To: [email protected]
Sent: Wednesday, July 12, 2006 11:30 PM
Subject: Re: [Rails] Re: Recurring mySQL Error

The same thing happens to me, and later when i have install on my other
windows box and a mac, never happened again.
Ruby R. wrote:

Joe,
I had the same problem. The problem was with different versions of
MySQL+Ruby. I compile mysql.so for mysql4.1 on winXP and than it worked.
See if you have latest versions for both ruby and mmysql.

On 7/12/06, Joe C. [email protected] wrote:

using the default timeout which is probably too long.

This problem seemed to start happening when I started storing my
sessions in a table, but I can pin it down to exactly that.

Anyone have any ideas? I’m completely stumped on this one.

This is a known problem with the pure Ruby MySQL driver. The solution is
to
use the C-based MySQL driver instead. Unfortunately, at the time of the
last
Instant Rails release, the C-based driver was crashing with segfaults so
we
had to back out to the native Ruby driver.

The good news is that the bugs in the C-based driver have been fixed.
This
will be included in the next release od Instant Rails. You can install
it
yourself in the meantime:

http://www.vandomburg.net/pages/mysql-ruby-windows

Please let me know if this fixes you problem.

Curt

Joe - I would like to know if this fixed your problems. I’m having
the same problem!

Thanks,
Ben L.

Ben L. wrote:

Joe - I would like to know if this fixed your problems. I’m having
the same problem!

Thanks,
Ben L.

Hi Ben:

Upgrading seemed to take care of the problem, I’m running mysql 5.0.x
and ruby 1.8.4 and I haven’t seen the error since.

On Thu, 2006-07-13 at 06:07 -0500, Curt H. wrote:

    as well.

http://www.vandomburg.net/pages/mysql-ruby-windows

This also happens when you try to connect to a mysql 4.x server that is
using the old password format, which I ran into eariler this week:

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