I recently changed the session store in my app from file to DB (MySQL)
and now I seem to be getting “Lost connection to MySQL server during
query:” errors from MySQL.
"You can also get these errors if you send a query to the server that is
incorrect or too large. If mysqld receives a packet that is too large or
out of order, it assumes that something has gone wrong with the client
and closes the connection. If you need big queries (for example, if you
are working with big BLOB columns), you can increase the query limit by
setting the server’s max_allowed_packet variable, which has a default
value of 1MB. You may also need to increase the maximum packet size on
the client end. More information on setting the packet size is given in
Section B.2.9, “Packet too largeâ€. "
Has anyone seen a correlation between using the DB to store session data
and losing connections on MySQL?
Simply use the native win32 mySQL driver (It is available as a gem).
The ruby one got issues with win32.
The pb is very random. You can have everything working fine for a
while, then suddenly got the connection lost errors.
Add the directory that contains libmySQL.dll to your PATH (probably
C:\Program Files\MySQL\MySQL Server 5.0\bin)
If you are running your Rails app inside of a container such as
RadRails :), make sure you restart your app container.
NOTE: Alternatively you could move the libmySQL.dll file to a directory
in your PATH like C:\ruby but this is unwise as you could re-break
things when you upgrade your Ruby installation).