<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>error 2006 Archives - Dragonsoft Technology View</title>
	<atom:link href="https://blog.dragonsoft.us/tag/error-2006/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.dragonsoft.us/tag/error-2006/</link>
	<description>Talk about Technologies, Software Architecture and Management</description>
	<lastBuildDate>Wed, 24 Mar 2010 05:36:52 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0</generator>

<image>
	<url>https://blog.dragonsoft.us/wp-content/uploads/2022/04/logo-main-bw-150x150.png</url>
	<title>error 2006 Archives - Dragonsoft Technology View</title>
	<link>https://blog.dragonsoft.us/tag/error-2006/</link>
	<width>32</width>
	<height>32</height>
</image> 
<site xmlns="com-wordpress:feed-additions:1">2577970</site>	<item>
		<title>PHP, MySQL and error &#8220;2006: MySQL server has gone away&#8221;</title>
		<link>https://blog.dragonsoft.us/2010/03/24/php-mysql-and-error-2006-mysql-server-has-gone-away/</link>
					<comments>https://blog.dragonsoft.us/2010/03/24/php-mysql-and-error-2006-mysql-server-has-gone-away/#respond</comments>
		
		<dc:creator><![CDATA[Serguei Dosyukov]]></dc:creator>
		<pubDate>Wed, 24 Mar 2010 05:34:07 +0000</pubDate>
				<category><![CDATA[Web-design]]></category>
		<category><![CDATA[enable reconnect]]></category>
		<category><![CDATA[error 2006]]></category>
		<category><![CDATA[Gallery 3]]></category>
		<category><![CDATA[menalto]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[MySQL server has gone away]]></category>
		<category><![CDATA[php]]></category>
		<guid isPermaLink="false">http://blog.dragonsoft.us/?p=1129</guid>

					<description><![CDATA[<p>As a hobby I like to do little photography. Same time I do not like to give my photos to someone else to host, so I have my gallery. It runs on Menalto&#8217;s Gallery 3 engine &#8211; nice, open source, PHP based with MySQL back-end. Not my primary programming language,<a class="moretag" href="https://blog.dragonsoft.us/2010/03/24/php-mysql-and-error-2006-mysql-server-has-gone-away/"> Read more</a></p>
<p>The post <a href="https://blog.dragonsoft.us/2010/03/24/php-mysql-and-error-2006-mysql-server-has-gone-away/">PHP, MySQL and error &#8220;2006: MySQL server has gone away&#8221;</a> appeared first on <a href="https://blog.dragonsoft.us">Dragonsoft Technology View</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>As a hobby I like to do little photography.</p>
<p>Same time I do not like to give my photos to someone else to host, so I have my gallery.</p>
<p>It runs on Menalto&#8217;s Gallery 3 engine &#8211; nice, open source, PHP based with MySQL back-end.</p>
<p>Not my primary programming language, but allows me to host and enhance my blog, keep my gallery and small web-site.</p>
<p>Last night, while bringing some old photos over from my backup gallery (G3 is still under development and I do not want to recreate gallery if anything to happen, and it did &#8211; I killed the setup&#8230;), I noticed that import process start to fail. Several attempts to recover did not give much of the progress and I went digging error logs.</p>
<div>
<p>Well,.. I learned something interesting. I am not a PHP programmer, at least it is not that I do for living, or not at this time&#8230; but even doing simple house work forces you learn things <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" /><br />
G3 runs on Kohana framework and there is a wrapper for DB access.</p>
<p>What happend was that some of the SQL requests began timing out</p>
<blockquote><p>Database_Exception [ 44 ]: #2006: MySQL server has gone away</p></blockquote>
<p>In case when queries are not optimal, one has to learn how to manage PHP&#8230; through php.ini&#8230;</p>
<p>MySQL timeout related errors are &#8220;fixed&#8221; by telling mysql to reconnect&#8230; and for that &#8220;tricks&#8221; are handy&#8230;<br />
From browsing, reading, browsing, filtering, &#8230; while waiting for G2 Import I have found a solution which lead me <a href="http://www.php.net/manual/en/ini.list.php" target="_blank">here</a>. One of interest is called <strong>mysqli.reconnect</strong>. Little magic &#8211; simply adding the following line in PHP.INI would tell MySQL reconnect.</p>
<blockquote><p>mysqli.reconnect=1</p></blockquote>
<p>It may be still slow, but at least connection would recover gracefully.</p>
<p>We can talk about code styles, code protection and error handling, but line above is a hidden gold on the end of the rainbow called PHP.</p>
</div>
<hr/><span style="font-size: 7pt">Copyright &copy; 2026 <strong><a href="https://blog.dragonsoft.us">Dragonsoft Technology View</a></strong>. This Feed is for personal non-commercial use only.</span><p>The post <a href="https://blog.dragonsoft.us/2010/03/24/php-mysql-and-error-2006-mysql-server-has-gone-away/">PHP, MySQL and error &#8220;2006: MySQL server has gone away&#8221;</a> appeared first on <a href="https://blog.dragonsoft.us">Dragonsoft Technology View</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.dragonsoft.us/2010/03/24/php-mysql-and-error-2006-mysql-server-has-gone-away/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1129</post-id>	</item>
	</channel>
</rss>

<!--
Performance optimized by W3 Total Cache. Learn more: https://www.boldgrid.com/w3-total-cache/?utm_source=w3tc&utm_medium=footer_comment&utm_campaign=free_plugin

Page Caching using Disk: Enhanced 
Lazy Loading (feed)
Minified using Disk
Database Caching 14/83 queries in 0.210 seconds using Disk

Served from: blog.dragonsoft.us @ 2026-06-22 03:31:40 by W3 Total Cache
-->