Page 1 of 1

Lost connection to MySQL server during query

Posted: Wed 09 Jul 2008 21:21
by sumit
Hi

We are using v3.55 of the MyDirect.Net drivers to connect to MySQL version 5.0.22 pro. When running an ALTER query on a large table, we run in to "Lost connection to MySQL server during query" error.

The error occurs exactly 2 mins after executing the command against the database. If I use another MySQL client like SQLYog, the query executes fine but does take about 8 mins to complete.

The connection string looks like this:
User Id=userId;Password=pwd;Port=3306;Host=hostName;Database=dbName

Is there a way to increase the 2 min timeout value somehow? The timeout values on the server side are abundant and are definitely way more than 2 minutes so this has to be a client issue. Is there a way to specify auto reconnect using Corelab drivers?

This issue is critical for us to fix asap. Please help.

Posted: Thu 10 Jul 2008 01:26
by sumit
Figured out the problem...

The command.commandTimeout was set to 2 minutes deep down somewhere and hence queries were getting timed out after 2 minutes. Only if the error message was more useful... :)