<?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>chetangole.com/blog/ &#187; Database</title>
	<atom:link href="http://chetangole.com/blog/tag/database/feed/" rel="self" type="application/rss+xml" />
	<link>http://chetangole.com/blog</link>
	<description>Version alpha or beta ... still calculating.</description>
	<lastBuildDate>Mon, 12 Sep 2011 17:09:02 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>WordPress database error MySQL server has gone away for query in WordPress 2.7</title>
		<link>http://chetangole.com/blog/2008/12/wordpress-database-error-mysql-server-has-gone-away-for-query-in-wordpress-27/</link>
		<comments>http://chetangole.com/blog/2008/12/wordpress-database-error-mysql-server-has-gone-away-for-query-in-wordpress-27/#comments</comments>
		<pubDate>Sat, 13 Dec 2008 14:55:36 +0000</pubDate>
		<dc:creator>Chetan</dc:creator>
				<category><![CDATA[Blogging]]></category>
		<category><![CDATA[blogging]]></category>
		<category><![CDATA[cPanel]]></category>
		<category><![CDATA[Database]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[Webmaster]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://chetangole.com/blog/?p=1092</guid>
		<description><![CDATA[Recently i optimize my WordPress for performance with many tweaks like deleting useless tables from database. Installed WP-Super cache, etc. I was checking the error_log file in my Filemanager i was shocked due to its size, it was 14MB large !. I download it and opened it, all the errors were related to Database. Almost [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://chetangole.com/blog/wp-content/uploads/2008/12/ico_wp_database.gif" alt="ico_wp_database" title="ico_wp_database" width="92" height="117" class="alignleft size-full wp-image-1093" />Recently i optimize my <a href="http://Wordpress.org" target="_blank" rel="nofollow">WordPress</a> for performance with many tweaks like deleting useless tables from database. Installed WP-Super cache, etc.<br />
 I was checking the error_log file in my Filemanager i was shocked due to its size, it was 14MB large !. I download it and opened it, all the errors were related to Database.<span id="more-1092"></span><br />
 Almost all lines were starting with<br />
&#8220;<b>WordPress database error MySQL server has gone away for query</b>&#8230;..&#8221;<br />
and few were like this<br />
&#8220;<b>WordPress database error Lost connection to MySQL server during query for query</b>&#8230;..&#8221;</p>
<p>As per the Error statement, the error clearly notifies that the connection between the WordPress and MySQL database was not proper. I just searched Google and seen many results, then i got the idea that its a General problem for many wordpress users.</p>
<p>Rob given a solution for this problem with few patched files to be replaced, You can read his article &#8220;<a href="http://robsnotebook.com/wordpress-mysql-gone-away" target="_blank" rel="nofollow">Workaround for WordPress database error</a>&#8220;. The article give detailed information about this problem.  He also given files to be replaced to solve this problem.</p>
<p>According to him, This error is cause due to improper coordination between database and WordPress PHP commands.</p>
<p>According to Rob ,</p>
<blockquote><p>
When someone tries to view one of your WordPress web pages, the PHP code first opens a connection to the MySQL server. Subsequent queries to the MySQL server rely on the connection remaining open, and do not re-open the connection. If the connection to the server happened to have shut down before a query is made, then WordPress will display this error.</p></blockquote>
<p>So for that you need to change the value of &#8220;<strong>wait_timeout</strong>&#8221; variable, either ask your <a href="http://www.webhostingsearch.com/" title="site hosting" target="_blank">site hosting</a> admin to do it for your else you can do it by your self by tweaking your wordpress file named <strong>wp-db.php</strong>.</p>
<p>Rob given replacement files for WordPress upto version 2.6.1 but recently <a href="http://chetangole.com/blog/2008/12/finally-wordpress-27-is-here/">WordPress 2.7 is released</a> so how to do the patch for <strong>WordPress 2.7</strong> ?</p>
<p>Here i am including the file to be replaced by original &#8220;wp-db.php&#8221; file for WordPress 2.7.</p>
<blockquote><p><a href="http://chetangole.com/blog/wp-content/uploads/2008/12/origionalwp-db.phptxt" rel="nofollow">Original wp-db.php</a><br />
<a href="http://chetangole.com/blog/wp-content/uploads/2008/12/workaroundwp-db.phptxt" rel="nofollow">Workaround wp-db.php</a></p></blockquote>
<p>Make sure you Backup your database and other files.</p>
<p>In above Workaround file, i just added </p>
<blockquote><p><code>$this-&gt;query("set session wait_timeout=600");</code> </p></blockquote>
<p>in line number 334 in original file.</p>
<p>So do Check your Error log file today, else this may cause increase in your site loading time.</p>
]]></content:encoded>
			<wfw:commentRss>http://chetangole.com/blog/2008/12/wordpress-database-error-mysql-server-has-gone-away-for-query-in-wordpress-27/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
	</channel>
</rss>

