<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>How to fix "MySQL server has gone away" (error 2006)</title>
	<atom:link href="http://bogdan.org.ua/2008/12/25/how-to-fix-mysql-server-has-gone-away-error-2006.html/feed" rel="self" type="application/rss+xml" />
	<link>http://bogdan.org.ua/2008/12/25/how-to-fix-mysql-server-has-gone-away-error-2006.html</link>
	<description>Tiny bits of bioinformatics, [web-]programming etc</description>
	<lastBuildDate>Sun, 14 Mar 2010 08:55:31 +0200</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
	<item>
		<title>How to fix "MySQL server has gone away" (error 2006)</title>
		<link>http://bogdan.org.ua/2008/12/25/how-to-fix-mysql-server-has-gone-away-error-2006.html/comment-page-1#comment-104360</link>
		<dc:creator>Sargo Darya</dc:creator>
		<pubDate>Wed, 24 Feb 2010 14:27:47 +0000</pubDate>
		<guid isPermaLink="false">http://bogdan.org.ua/?p=464#comment-104360</guid>
		<description>Thanks, worked instantly.</description>
		<content:encoded><![CDATA[<p><!-- google_ad_section_start -->Thanks, worked instantly.<!-- google_ad_section_end --></p>
]]></content:encoded>
	</item>
	<item>
		<title>How to fix "MySQL server has gone away" (error 2006)</title>
		<link>http://bogdan.org.ua/2008/12/25/how-to-fix-mysql-server-has-gone-away-error-2006.html/comment-page-1#comment-104355</link>
		<dc:creator>mars</dc:creator>
		<pubDate>Wed, 24 Feb 2010 05:47:17 +0000</pubDate>
		<guid isPermaLink="false">http://bogdan.org.ua/?p=464#comment-104355</guid>
		<description>it works like a charm.. problem solved. thanks uploader</description>
		<content:encoded><![CDATA[<p><!-- google_ad_section_start -->it works like a charm.. problem solved. thanks uploader<!-- google_ad_section_end --></p>
]]></content:encoded>
	</item>
	<item>
		<title>How to fix "MySQL server has gone away" (error 2006)</title>
		<link>http://bogdan.org.ua/2008/12/25/how-to-fix-mysql-server-has-gone-away-error-2006.html/comment-page-1#comment-104341</link>
		<dc:creator>GBo</dc:creator>
		<pubDate>Tue, 23 Feb 2010 00:32:05 +0000</pubDate>
		<guid isPermaLink="false">http://bogdan.org.ua/?p=464#comment-104341</guid>
		<description>RJB THANK YOU!

FINALLY SOME USEFUL ADVICE! I have been trying to figure this out for hours and followed all this high tech advice that got me wrapped up in all sorts of things I didn&#039;t need to be wasting my time with. I can&#039;t believe it was as simple as clicking a box and no one else thought to mention that before handing out all these complicated suggestions.</description>
		<content:encoded><![CDATA[<p><!-- google_ad_section_start -->RJB THANK YOU!</p>
<p>FINALLY SOME USEFUL ADVICE! I have been trying to figure this out for hours and followed all this high tech advice that got me wrapped up in all sorts of things I didn&#8217;t need to be wasting my time with. I can&#8217;t believe it was as simple as clicking a box and no one else thought to mention that before handing out all these complicated suggestions.<!-- google_ad_section_end --></p>
]]></content:encoded>
	</item>
	<item>
		<title>How to fix "MySQL server has gone away" (error 2006)</title>
		<link>http://bogdan.org.ua/2008/12/25/how-to-fix-mysql-server-has-gone-away-error-2006.html/comment-page-1#comment-103491</link>
		<dc:creator>Bogdan</dc:creator>
		<pubDate>Thu, 21 Jan 2010 15:26:27 +0000</pubDate>
		<guid isPermaLink="false">http://bogdan.org.ua/?p=464#comment-103491</guid>
		<description>RJB - thanks, I&#039;ve updated post text to point at your comment.</description>
		<content:encoded><![CDATA[<p><!-- google_ad_section_start -->RJB &#8211; thanks, I&#8217;ve updated post text to point at your comment.<!-- google_ad_section_end --></p>
]]></content:encoded>
	</item>
	<item>
		<title>How to fix "MySQL server has gone away" (error 2006)</title>
		<link>http://bogdan.org.ua/2008/12/25/how-to-fix-mysql-server-has-gone-away-error-2006.html/comment-page-1#comment-103489</link>
		<dc:creator>RJB</dc:creator>
		<pubDate>Thu, 21 Jan 2010 14:04:23 +0000</pubDate>
		<guid isPermaLink="false">http://bogdan.org.ua/?p=464#comment-103489</guid>
		<description>I came across this error message while experimenting with the MySQL ODBC 5.1 Driver.

I am considering transferring my Access databases to a MySQL server, but some of my users are accustomed to using Access on the front end. To make the change transparent for them, I may have them use Access with tables linked to the MySQL database via the ODBC driver.

When configuring the Machine Data Source for the ODBC connection, the MySQL Connector/ODBC GUI opens. By expanding the “Details”, selecting tab “Flag 1” and checking the “Enable automatic reconnect” option, the “MySQL server has gone away (error 2006)” problem was eliminated.

This was preferred over messing with the cnf files. I hope this helps.</description>
		<content:encoded><![CDATA[<p><!-- google_ad_section_start -->I came across this error message while experimenting with the MySQL ODBC 5.1 Driver.</p>
<p>I am considering transferring my Access databases to a MySQL server, but some of my users are accustomed to using Access on the front end. To make the change transparent for them, I may have them use Access with tables linked to the MySQL database via the ODBC driver.</p>
<p>When configuring the Machine Data Source for the ODBC connection, the MySQL Connector/ODBC GUI opens. By expanding the “Details”, selecting tab “Flag 1” and checking the “Enable automatic reconnect” option, the “MySQL server has gone away (error 2006)” problem was eliminated.</p>
<p>This was preferred over messing with the cnf files. I hope this helps.<!-- google_ad_section_end --></p>
]]></content:encoded>
	</item>
	<item>
		<title>How to fix "MySQL server has gone away" (error 2006)</title>
		<link>http://bogdan.org.ua/2008/12/25/how-to-fix-mysql-server-has-gone-away-error-2006.html/comment-page-1#comment-102543</link>
		<dc:creator>Piscal Pisali</dc:creator>
		<pubDate>Sun, 11 Oct 2009 18:11:39 +0000</pubDate>
		<guid isPermaLink="false">http://bogdan.org.ua/?p=464#comment-102543</guid>
		<description>Thanks for the reports. I am getting same error while restoring database.
Regards</description>
		<content:encoded><![CDATA[<p><!-- google_ad_section_start -->Thanks for the reports. I am getting same error while restoring database.<br />
Regards<!-- google_ad_section_end --></p>
]]></content:encoded>
	</item>
	<item>
		<title>How to fix "MySQL server has gone away" (error 2006)</title>
		<link>http://bogdan.org.ua/2008/12/25/how-to-fix-mysql-server-has-gone-away-error-2006.html/comment-page-1#comment-102151</link>
		<dc:creator>Bogdan</dc:creator>
		<pubDate>Sat, 29 Aug 2009 10:43:42 +0000</pubDate>
		<guid isPermaLink="false">http://bogdan.org.ua/?p=464#comment-102151</guid>
		<description>hey, I&#039;m not one of MySQL developers :)

1), 2) To the best of my knowledge, MySQL is &#039;thread-safe&#039; for writing operations, because locking is used (table-level for MyISAM or row-level for InnoDB, if I&#039;m not mistaken). So I guess &#039;incorrect&#039; has nothing to do with multi-threading. Other than that, I would advise searching for this error on MySQL website - they do have nice explanations, although one may have to search deeper to find those nice explanations. Also, I would advise trying to increase packet size in my.cnf - just to see if that helps.

3) I have no idea what 2014 means, I&#039;ve never had this error, and thus have never had a look at its description. Also, I&#039;m using Unix sockets to connect to MySQL, not TCP port 3306 (on a single machine).

4) You can detect any error using standard means of your programming/scripting language of choice (e.g. PHP, Python, Ruby). You can do this either at application layer, at some common database layer, or even both. Exact answer depends on your specific software architecture. As for continuing: again, you can sleep(couple of seconds) and then re-establish MySQL connection using standard means of your programming language of choice.

Also, you can monitor mysql.error alterations (system-wide), and perform some action (e.g. graceful restart :) ) as soon as log has &#039;2006&#039; error entry. The simplest way to do this is a bash script, doing &#039;tail -f mysql.error &#124; grep 2006&#039; and restarting mysql whenever new error line appears :)

Finally, do have a look at error description on MySQL website. That is an enlightening experience.</description>
		<content:encoded><![CDATA[<p><!-- google_ad_section_start -->hey, I&#8217;m not one of MySQL developers <img src='http://bogdan.org.ua/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>1), 2) To the best of my knowledge, MySQL is &#8216;thread-safe&#8217; for writing operations, because locking is used (table-level for MyISAM or row-level for InnoDB, if I&#8217;m not mistaken). So I guess &#8216;incorrect&#8217; has nothing to do with multi-threading. Other than that, I would advise searching for this error on MySQL website &#8211; they do have nice explanations, although one may have to search deeper to find those nice explanations. Also, I would advise trying to increase packet size in my.cnf &#8211; just to see if that helps.</p>
<p>3) I have no idea what 2014 means, I&#8217;ve never had this error, and thus have never had a look at its description. Also, I&#8217;m using Unix sockets to connect to MySQL, not TCP port 3306 (on a single machine).</p>
<p>4) You can detect any error using standard means of your programming/scripting language of choice (e.g. PHP, Python, Ruby). You can do this either at application layer, at some common database layer, or even both. Exact answer depends on your specific software architecture. As for continuing: again, you can sleep(couple of seconds) and then re-establish MySQL connection using standard means of your programming language of choice.</p>
<p>Also, you can monitor mysql.error alterations (system-wide), and perform some action (e.g. graceful restart <img src='http://bogdan.org.ua/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  ) as soon as log has &#8216;2006&#8242; error entry. The simplest way to do this is a bash script, doing &#8216;tail -f mysql.error | grep 2006&#8242; and restarting mysql whenever new error line appears <img src='http://bogdan.org.ua/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Finally, do have a look at error description on MySQL website. That is an enlightening experience.<!-- google_ad_section_end --></p>
]]></content:encoded>
	</item>
	<item>
		<title>How to fix "MySQL server has gone away" (error 2006)</title>
		<link>http://bogdan.org.ua/2008/12/25/how-to-fix-mysql-server-has-gone-away-error-2006.html/comment-page-1#comment-102137</link>
		<dc:creator>Mabooka-Mabooka</dc:creator>
		<pubDate>Fri, 28 Aug 2009 04:44:42 +0000</pubDate>
		<guid isPermaLink="false">http://bogdan.org.ua/?p=464#comment-102137</guid>
		<description>Thank for this useful reply!

(Unfortunately, in search results, it comes way after some very old and ~mostly~ meaningless discussion going back into 2003 -- http://community.norton.com/norton/board?board.id=norton_mac ).

Well, it&#039;s 2009 now, and it seems that this is still a problem (lacking unambiguous explanation and a single recipe to solve it) for some people. (2003+2009)/2.

I&#039;m seeing it for the 1st time in my life -- on Mac OS X (Leopard). I am confused. Please read on.

===
I am sure that in my case the size (of the query + data) is not the reason: the query it drops off on is a very simple select from a single small table. On the other hand, this query might be sent quite often (say 100 times / second), and that&#039;s perhaps the reason why (?in my case).

I&#039;d like to: 
1) ask you to elaborate: what is &quot;an incorrect or too large packet&quot;?  Specifically -- &quot;incorrect&quot;.
(My server is multi-threaded and, at least in theory, queries might come from diff. threads ~~almost simultaneously: does MySQL handle this appropriately?).

2) In my case, fixing this by tweaking the *.cnf is not exactly what I am looking for. 
If a mysql server cannot handle smth., I&#039;ll scale horizontally; but at the same time i need to know ***how and what to measure***. So the question is: what (now officially from MySQL GURUs) can cause this 2006 error exactly?

BTW: 
3) I sometimes see the &quot;2006&quot; accompanied by this:
2014, &quot;Commands out of sync; you can&#039;t run this command now&quot;

And, I am reading here and there about &quot;&quot;&quot;~~~packets coming out of order~~~&quot;&quot;&quot;.

What the hell does THAT supposed  to mean? How the commands ***may*** come out of sync, who is responsible? And, ab. &quot;packets out of order&quot;: does it imply that the TCP layer is &quot;out of order&quot;? (I doubt it very much).


3) For the worst case scenario: 
I need to fix this in real time; in a worst case, I&#039;ll loose an incoming message but I need to continue serving others non-stop.

The question is: how to detect this particular error and continue (probably re-connect?) wisely?

~~~
Please advice some more:-). 

// I think it is unproductive to discuss whether this is a bug or a feature or something else. It is definitely an issue for many.

Thanks in advance!</description>
		<content:encoded><![CDATA[<p><!-- google_ad_section_start -->Thank for this useful reply!</p>
<p>(Unfortunately, in search results, it comes way after some very old and ~mostly~ meaningless discussion going back into 2003 &#8212; <a href="http://community.norton.com/norton/board?board.id=norton_mac" rel="nofollow">http://community.norton.com/norton/board?board.id=norton_mac</a> ).</p>
<p>Well, it&#8217;s 2009 now, and it seems that this is still a problem (lacking unambiguous explanation and a single recipe to solve it) for some people. (2003+2009)/2.</p>
<p>I&#8217;m seeing it for the 1st time in my life &#8212; on Mac OS X (Leopard). I am confused. Please read on.</p>
<p>===<br />
I am sure that in my case the size (of the query + data) is not the reason: the query it drops off on is a very simple select from a single small table. On the other hand, this query might be sent quite often (say 100 times / second), and that&#8217;s perhaps the reason why (?in my case).</p>
<p>I&#8217;d like to:<br />
1) ask you to elaborate: what is &#8220;an incorrect or too large packet&#8221;?  Specifically &#8212; &#8220;incorrect&#8221;.<br />
(My server is multi-threaded and, at least in theory, queries might come from diff. threads ~~almost simultaneously: does MySQL handle this appropriately?).</p>
<p>2) In my case, fixing this by tweaking the *.cnf is not exactly what I am looking for.<br />
If a mysql server cannot handle smth., I&#8217;ll scale horizontally; but at the same time i need to know ***how and what to measure***. So the question is: what (now officially from MySQL GURUs) can cause this 2006 error exactly?</p>
<p>BTW:<br />
3) I sometimes see the &#8220;2006&#8243; accompanied by this:<br />
2014, &#8220;Commands out of sync; you can&#8217;t run this command now&#8221;</p>
<p>And, I am reading here and there about &#8220;&#8221;"~~~packets coming out of order~~~&#8221;"&#8221;.</p>
<p>What the hell does THAT supposed  to mean? How the commands ***may*** come out of sync, who is responsible? And, ab. &#8220;packets out of order&#8221;: does it imply that the TCP layer is &#8220;out of order&#8221;? (I doubt it very much).</p>
<p>3) For the worst case scenario:<br />
I need to fix this in real time; in a worst case, I&#8217;ll loose an incoming message but I need to continue serving others non-stop.</p>
<p>The question is: how to detect this particular error and continue (probably re-connect?) wisely?</p>
<p>~~~<br />
Please advice some more:-). </p>
<p>// I think it is unproductive to discuss whether this is a bug or a feature or something else. It is definitely an issue for many.</p>
<p>Thanks in advance!<!-- google_ad_section_end --></p>
]]></content:encoded>
	</item>
	<item>
		<title>How to fix "MySQL server has gone away" (error 2006)</title>
		<link>http://bogdan.org.ua/2008/12/25/how-to-fix-mysql-server-has-gone-away-error-2006.html/comment-page-1#comment-101949</link>
		<dc:creator>حرب الملوك</dc:creator>
		<pubDate>Fri, 24 Jul 2009 17:37:24 +0000</pubDate>
		<guid isPermaLink="false">http://bogdan.org.ua/?p=464#comment-101949</guid>
		<description>Thanx

I&#039;ll try this fix and see what happen</description>
		<content:encoded><![CDATA[<p><!-- google_ad_section_start -->Thanx</p>
<p>I&#8217;ll try this fix and see what happen<!-- google_ad_section_end --></p>
]]></content:encoded>
	</item>
</channel>
</rss>
