<?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>Veblog &#187; mysql</title>
	<atom:link href="http://www.vegayan.com/veblog/category/mysql/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.vegayan.com/veblog</link>
	<description></description>
	<lastBuildDate>Thu, 19 Jan 2012 08:51:56 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.4</generator>
		<item>
		<title>MySQL Error 2013</title>
		<link>http://www.vegayan.com/veblog/2007/07/31/mysql-error-2013/</link>
		<comments>http://www.vegayan.com/veblog/2007/07/31/mysql-error-2013/#comments</comments>
		<pubDate>Tue, 31 Jul 2007 05:30:20 +0000</pubDate>
		<dc:creator>veblog</dc:creator>
				<category><![CDATA[Technical]]></category>
		<category><![CDATA[koteshwara]]></category>
		<category><![CDATA[mysql]]></category>

		<guid isPermaLink="false">http://veblog.wordpress.com/2007/07/31/mysql-error-2013/</guid>
		<description><![CDATA[Of all MySQL errors, Error Number 2013 is most frustrating and annoying. MySQL Errors like 1062(Duplicate Entry), 2002(Server is not started), 2006(Server has gone away) are easy to identify and solve. 2013 signifies lost connection to server in midst of query execution. 2013 is frustrating because, you can&#8217;t produce it again for same sequence of [...]]]></description>
			<content:encoded><![CDATA[<p>Of all MySQL errors, Error Number 2013 is most frustrating and annoying.</p>
<p>MySQL Errors like 1062(Duplicate Entry), 2002(Server is not started), 2006(Server has gone away) are easy to identify and solve. 2013 signifies lost connection to server in midst of query execution.</p>
<p>2013 is frustrating because, you can&#8217;t produce it again for same sequence of actions. So you never know when it will come or when it won&#8217;t.</p>
<p>Finally, I have come up with few points to look for when MySQL Error 2013 occurs.</p>
<p>1. check for MySQL Status<br />
shell&gt; mysql -u root -p -e &#8220;\s&#8221; | grep Uptime</p>
<p>It will give uptime of MySQL Server. If it is less than 1 min, then server must have gone down and started again. So, you have look for Status Variable wait_timeout. By default, wait-timeout will be 28800 sec (8 Hours). Developer can change it while starting a server(change has to be done in my.cnf file) or by setting parameter &#8220;CLIENT_INTERACTIVE&#8221; <code></code>in &#8220;mysql_real_connect()&#8221;.<code><span style="font-family:arial,mon;"> </span></code>If Uptime is not less than a min, then there is a problem with Query.</p>
<p>Query can be too long or it is syntactically correct but not semantically.</p>
<p><span style="font-weight:bold;">Example:</span> I am running a stored procedure spLogin(uname, pword, status). Here uname and pword are input parameters and status output parameter. To supply input to this stored procedure, I use user defined variables.</p>
<p>So, order of queries will be<br />
mysql &gt; SET @user = &#8216;sarma&#8217;, @passwd = &#8216;sarma&#8217;;<br />
mysql &gt; call spLogin(@username, @password, @status);<br />
There is a chance that it will give an error 2013, as query is syntactically correct, but values passed to query are garbage.</p>
<p>Remedy will be<br />
mysql&gt; call spLogin(@user, @passwd, @status);<br />
query Success(if stored procedure is correct).</p>
<p>But as I said earlier, it is tough to reproduce Error 2013. Care should be taken in passing inputs to either Queries or Stored Procedures and wait_timeout should be atleast 4 Hrs.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.vegayan.com/veblog/2007/07/31/mysql-error-2013/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

