<?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>DBAlife &#187; mysql</title>
	<atom:link href="http://www.dbalife.com/archives/tag/mysql/feed" rel="self" type="application/rss+xml" />
	<link>http://www.dbalife.com</link>
	<description>星光照耀前方</description>
	<lastBuildDate>Wed, 14 Jul 2010 08:13:46 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>64位centOS编译php5.3时的小问题</title>
		<link>http://www.dbalife.com/archives/389.html</link>
		<comments>http://www.dbalife.com/archives/389.html#comments</comments>
		<pubDate>Wed, 07 Jul 2010 05:48:33 +0000</pubDate>
		<dc:creator>skywalker</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[64bit]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[libmysqlclient]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.dbalife.com/?p=389</guid>
		<description><![CDATA[64位CentOS5.5在编译php5.3时，提示找不到libmysqlclient，
checking for MING support... no
checking for mSQL support... no
checking for MSSQL support via FreeTDS... no
checking for MySQL support... yes, shared
checking for specified location of the MySQL UNIX socket... no
checking for MySQL UNIX socket location... no
configure: error: Cannot find libmysqlclient under /usr.
Note that the MySQL client library is not bundled anymore!
这是由于搜索路径有误，需在编译时增加一个参数： "--with-libdir=lib64"


Related posts:PIX logging Architecture所需perl module的几点注意



Related posts:<ol><li><a href='http://www.dbalife.com/archives/133.html' rel='bookmark' title='Permanent Link: PIX logging Architecture所需perl module的几点注意'>PIX logging Architecture所需perl module的几点注意</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>64位CentOS5.5在编译php5.3时，提示找不到libmysqlclient，</p>
<p>checking for MING support... no<br />
checking for mSQL support... no<br />
checking for MSSQL support via FreeTDS... no<br />
checking for MySQL support... yes, shared<br />
checking for specified location of the MySQL UNIX socket... no<br />
checking for MySQL UNIX socket location... no<br />
configure: error: Cannot find libmysqlclient under /usr.<br />
Note that the MySQL client library is not bundled anymore!</p>
<p>这是由于搜索路径有误，需在编译时增加一个参数： "--with-libdir=lib64"</p>


<p>Related posts:<ol><li><a href='http://www.dbalife.com/archives/133.html' rel='bookmark' title='Permanent Link: PIX logging Architecture所需perl module的几点注意'>PIX logging Architecture所需perl module的几点注意</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.dbalife.com/archives/389.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Mysql中的STRICT_TRANS_TABLES</title>
		<link>http://www.dbalife.com/archives/339.html</link>
		<comments>http://www.dbalife.com/archives/339.html#comments</comments>
		<pubDate>Fri, 15 Jan 2010 19:39:52 +0000</pubDate>
		<dc:creator>skywalker</dc:creator>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[Program]]></category>
		<category><![CDATA[my.ini]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[STRICT_TRANS_TABLES]]></category>
		<category><![CDATA[symfony]]></category>

		<guid isPermaLink="false">http://www.dbalife.com/?p=339</guid>
		<description><![CDATA[在调试php symfony，加载fixture数据时，遇到了错误：
SQLSTATE[HY000]: General error: 1366 Incorrect integer value: 'log' for column 'tasklog_id' at row 1
这是因为mysql5.5中默认启用了STRICT_TRANS_TABLES参数。
STRICT_TRANS_TABLES的工作方式：
　　· 对于事务性存储引擎，在语句中任何地方出现的不良数据值均会导致放弃语句并执行回滚。
        · 对于非事务性存储引擎，如果错误出现在要插入或更新的第1行，将放弃语句。（在这种情况下，可以认为语句未改变表，就像事务表一样）。首行后出现的错误不会导致放弃语句。取而代之的是，将调整不良数据值，并给出告警，而不是错误。换句话讲，使用STRICT_TRANS_TABLES后，错误值会导致MySQL执行回滚操作，如果可以，所有更新到此为止。
　　要想执行更严格的检查，请启用STRICT_ALL_TABLES。除了非事务性存储引擎，它与STRICT_TRANS_TABLES等同，即使当不良数据出现在首行后的其他行，所产生的错误也会导致放弃语句。这意味着，如果错误出现在非事务性表多行插入或更新过程的中途，仅更新部分结果。前面的行将完成插入或更新，但错误出现点后面的行则不然。
因此，解决方法就是在my.ini里把STRICT_TRANS_TABLES关掉

?View Code C#Set the SQL mode to strict
#sql-mode=&#34;STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION&#34;
sql-mode=&#34;NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION&#34;



No related posts.


No related posts.]]></description>
			<content:encoded><![CDATA[<p>在调试php symfony，加载fixture数据时，遇到了错误：</p>
<blockquote><p>SQLSTATE[HY000]: General error: 1366 Incorrect integer value: 'log' for column 'tasklog_id' at row 1</p></blockquote>
<p>这是因为mysql5.5中默认启用了<em>STRICT_TRANS_TABLES</em>参数。</p>
<p>STRICT_TRANS_TABLES的工作方式：<br />
　　· 对于事务性存储引擎，在语句中任何地方出现的不良数据值均会导致放弃语句并执行回滚。<br />
        · 对于非事务性存储引擎，如果错误出现在要插入或更新的第1行，将放弃语句。（在这种情况下，可以认为语句未改变表，就像事务表一样）。首行后出现的错误不会导致放弃语句。取而代之的是，将调整不良数据值，并给出告警，而不是错误。换句话讲，使用STRICT_TRANS_TABLES后，错误值会导致MySQL执行回滚操作，如果可以，所有更新到此为止。</p>
<p>　　要想执行更严格的检查，请启用STRICT_ALL_TABLES。除了非事务性存储引擎，它与STRICT_TRANS_TABLES等同，即使当不良数据出现在首行后的其他行，所产生的错误也会导致放弃语句。这意味着，如果错误出现在非事务性表多行插入或更新过程的中途，仅更新部分结果。前面的行将完成插入或更新，但错误出现点后面的行则不然。</p>
<p>因此，解决方法就是在my.ini里把STRICT_TRANS_TABLES关掉</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p339code2'); return false;">View Code</a> C</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p3392"><td class="code" id="p339code2"><pre class="c" style="font-family:monospace;"><span style="color: #339933;">#Set the SQL mode to strict</span>
<span style="color: #339933;">#sql-mode=&quot;STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION&quot;</span>
sql<span style="color: #339933;">-</span>mode<span style="color: #339933;">=</span><span style="color: #ff0000;">&quot;NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION&quot;</span></pre></td></tr></table></div>



<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://www.dbalife.com/archives/339.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mysql导入慢的解决方法</title>
		<link>http://www.dbalife.com/archives/213.html</link>
		<comments>http://www.dbalife.com/archives/213.html#comments</comments>
		<pubDate>Thu, 05 Feb 2009 17:19:40 +0000</pubDate>
		<dc:creator>skywalker</dc:creator>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[imp]]></category>
		<category><![CDATA[max_allowed_packet]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[mysqldump]]></category>
		<category><![CDATA[导入]]></category>
		<category><![CDATA[慢]]></category>

		<guid isPermaLink="false">http://www.dbalife.com/?p=213</guid>
		<description><![CDATA[MySQL导出的SQL语句在导入时有可能会非常非常慢，经历过导入仅45万条记录，竟用了近3个小时。在导出时合理使用几个参数，可以大大加快导入的速度。
-e 使用包括几个VALUES列表的多行INSERT语法;
--max_allowed_packet=XXX 客户端/服务器之间通信的缓存区的最大大小;
--net_buffer_length=XXX  TCP/IP和套接字通信缓冲区大小,创建长度达net_buffer_length的行。
注意：max_allowed_packet和net_buffer_length不能比目标数据库的设定数值大，否则可能出错。
首先确定目标库的参数值
mysql&#62;show variables like 'max_allowed_packet';
mysql&#62;show variables like 'net_buffer_length';
根据参数值书写mysqldump命令，如：
E:\eis&#62;mysqldump -uroot -p eis_db goodclassification -e --max_allowed_packet=1048576 --net_buffer_length=16384 &#62;good3.sql
之前2小时才能导入的sql现在几十秒就可以完成了。


No related posts.


No related posts.]]></description>
			<content:encoded><![CDATA[<p>MySQL导出的SQL语句在导入时有可能会非常非常慢，经历过导入仅45万条记录，竟用了近3个小时。在导出时合理使用几个参数，可以大大加快导入的速度。</p>
<blockquote><p>-e 使用包括几个VALUES列表的多行INSERT语法;<br />
--max_allowed_packet=XXX 客户端/服务器之间通信的缓存区的最大大小;<br />
--net_buffer_length=XXX  TCP/IP和套接字通信缓冲区大小,创建长度达net_buffer_length的行。</p></blockquote>
<p><strong>注意：</strong>max_allowed_packet和net_buffer_length不能比目标数据库的设定数值大，否则可能出错。</p>
<p>首先确定目标库的参数值</p>
<blockquote><p>mysql&gt;show variables like 'max_allowed_packet';<br />
mysql&gt;show variables like 'net_buffer_length';</p></blockquote>
<p>根据参数值书写mysqldump命令，如：<br />
E:\eis&gt;mysqldump -uroot -p eis_db goodclassification -e --max_allowed_packet=1048576 --net_buffer_length=16384 &gt;good3.sql</p>
<p>之前2小时才能导入的sql现在几十秒就可以完成了。</p>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://www.dbalife.com/archives/213.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
