<?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>荷包蛋博客 &#187; MySQL server</title>
	<atom:link href="http://www.hebaodans.com/tag/mysql-server/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.hebaodans.com</link>
	<description>好的心态是成功的开始</description>
	<lastBuildDate>Tue, 20 Jul 2010 17:32:08 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>MySQL server has gone away</title>
		<link>http://www.hebaodans.com/2009/03/m-y-s-q-l-s-e-r-v-e-r-h-a-s-g-o-n-e-a-w-a-y/</link>
		<comments>http://www.hebaodans.com/2009/03/m-y-s-q-l-s-e-r-v-e-r-h-a-s-g-o-n-e-a-w-a-y/#comments</comments>
		<pubDate>Sat, 21 Mar 2009 09:21:12 +0000</pubDate>
		<dc:creator></dc:creator>
				<category><![CDATA[mysql]]></category>
		<category><![CDATA[gone away]]></category>
		<category><![CDATA[mysql 2006]]></category>
		<category><![CDATA[MySQL server]]></category>
		<category><![CDATA[mysql数据库连接丢失]]></category>
		<category><![CDATA[mysql连接断开]]></category>

		<guid isPermaLink="false">http://www.hebaodans.com/?p=328</guid>
		<description><![CDATA[MySQL server has gone away有几种情况。 1、应用程序（比如PHP）长时间的执行批量的MYSQL语句。     最常见的就是采集或者新旧数据转化。     解决方案：      在my.cnf文件中添加或者修改以下两个变量： wait_timeout=2880000 interactive_timeout = 2880000          关于两个变量的具体说明可以google或者看官方手册。    如果不能修改my.cnf，则可以在连接数据库的时候设置CLIENT_INTERACTIVE，比如： sql = &#8220;set interactive_timeout=24*3600&#8243;; mysql_real_query(&#8230;) 2、执行一个SQL，但SQL语句过大或者语句中含有BLOB或者longblob字段。     比如，图片数据的处理     解决方案 在my.cnf文件中添加或者修改以下变量： max_allowed_packet = 10M(也可以设置自己需要的大小) max_allowed_packet 参数的作用是，用来控制其通信缓冲区的最大长度。 转载来源  http://www.phpobject.net/blog/read.php/141.htm]]></description>
			<content:encoded><![CDATA[<p><span class='wp_keywordlink_affiliate'><a href="http://www.hebaodans.com/tag/mysql-server/" title="View all posts in MySQL server" target="_blank">MySQL server</a></span> has <span class='wp_keywordlink_affiliate'><a href="http://www.hebaodans.com/tag/gone-away/" title="View all posts in gone away" target="_blank">gone away</a></span>有几种情况。<br />
<a name="entrymore"></a><br />
1、应用程序（比如PHP）长时间的执行批量的MYSQL语句。<br />
    最常见的就是采集或者新旧数据转化。<br />
    解决方案：<br />
    </p>
<div class="code">
在my.cnf文件中添加或者修改以下两个变量：<br />
wait_timeout=2880000<br />
interactive_timeout = 2880000<br />
    </div>
<p>    关于两个变量的具体说明可以google或者看官方手册。</p>
<p>   如果不能修改my.cnf，则可以在连接数据库的时候设置CLIENT_INTERACTIVE，比如：</p>
<div class="code">
sql = &#8220;set interactive_timeout=24*3600&#8243;;<br />
mysql_real_query(&#8230;)</div>
<p>2、执行一个SQL，但SQL语句过大或者语句中含有BLOB或者longblob字段。</p>
<p>    比如，图片数据的处理</p>
<p>    解决方案</p>
<div class="code">
在my.cnf文件中添加或者修改以下变量：<br />
max_allowed_packet = 10M(也可以设置自己需要的大小)</div>
<p>max_allowed_packet 参数的作用是，用来控制其通信缓冲区的最大长度。</p>
<p><!-- Added by RelatedTopic, plugin for Bo-Blog 2.0.0 -->转载来源  <a href="http://www.phpobject.net/blog/read.php/141.htm">http://www.phpobject.net/blog/read.php/141.htm</a></p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://www.hebaodans.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.hebaodans.com/2009/03/m-y-s-q-l-s-e-r-v-e-r-h-a-s-g-o-n-e-a-w-a-y/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Can’t connect to local MySQL server through socket 解决办法</title>
		<link>http://www.hebaodans.com/2008/12/cannot-connect-to-local-mysql-server-through-socket/</link>
		<comments>http://www.hebaodans.com/2008/12/cannot-connect-to-local-mysql-server-through-socket/#comments</comments>
		<pubDate>Sat, 20 Dec 2008 01:33:35 +0000</pubDate>
		<dc:creator></dc:creator>
				<category><![CDATA[mysql]]></category>
		<category><![CDATA[connect fail]]></category>
		<category><![CDATA[MySQL server]]></category>
		<category><![CDATA[mysql server连接失败]]></category>

		<guid isPermaLink="false">http://www.hebaodans.com/?p=162</guid>
		<description><![CDATA[启动mysql 报错： ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock’ (2) 1、先查看 /etc/rc.d/init.d/mysqld status 看看m y s q l 是否已经启动. 另外看看是不是权限问题. 2、确定你的mysql.sock是不是在那个位置， mysql -u 你的mysql用户名 -p -S /var/lib/mysql/mysql.sock 3、试试：service mysqld start 4、如果是权限问题，则先改变权限 #chown -R mysql:mysql /var/lib/mysql [root@localhost ~]# /etc/init.d/mysqld start 启动 MySQL： [ 确定 ] [root@localhost ~]# mysql -uroot -p 转载来源 [...]]]></description>
			<content:encoded><![CDATA[<p>启动mysql 报错：</p>
<p>ERROR 2002 (HY000): Can’t connect to local <span class='wp_keywordlink_affiliate'><a href="http://www.hebaodans.com/tag/mysql-server/" title="View all posts in MySQL server" target="_blank">MySQL server</a></span> through socket ‘/var/lib/mysql/mysql.sock’ (2)</p>
<p>1、先查看 /etc/rc.d/init.d/mysqld status 看看m y s q l 是否已经启动.<br />
另外看看是不是权限问题.</p>
<p>2、确定你的mysql.sock是不是在那个位置，<br />
mysql -u 你的mysql用户名 -p -S /var/lib/mysql/mysql.sock</p>
<p>3、试试：service mysqld start</p>
<p>4、如果是权限问题，则先改变权限 #chown -R mysql:mysql /var/lib/mysql</p>
<p>[root@localhost ~]# /etc/init.d/mysqld start<br />
启动 MySQL： [ 确定 ]<br />
[root@localhost ~]# mysql -uroot -p<br />
转载来源 http://www.d5s.cn/archives/9</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://www.hebaodans.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.hebaodans.com/2008/12/cannot-connect-to-local-mysql-server-through-socket/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
