<?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; STRICT_TRANS_TABLES</title>
	<atom:link href="http://www.zui88.com/view-tag/strict_trans_tables/feed" rel="self" type="application/rss+xml" />
	<link>http://www.zui88.com/blog</link>
	<description>中山php&#124;最优网络</description>
	<lastBuildDate>Mon, 13 May 2013 04:56:43 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.4</generator>
		<item>
		<title>mysql STRICT_TRANS_TABLES严格模式下提示Field &#039;id&#039; doesn&#039;t have a default value</title>
		<link>http://www.zui88.com/blog/view-411.html</link>
		<comments>http://www.zui88.com/blog/view-411.html#comments</comments>
		<pubDate>Wed, 26 Sep 2012 03:42:48 +0000</pubDate>
		<dc:creator>lin</dc:creator>
				<category><![CDATA[数据库]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[STRICT_TRANS_TABLES]]></category>

		<guid isPermaLink="false">http://www.zui88.com/blog/?p=411</guid>
		<description><![CDATA[在别的服务器运行我的网站程序的时候，出现了Field 'id' doesn't have a default value 的提示，意思是这个值我没有提交数据，并且数据库结构没有设置默认值，由于对方的mysql服务器开启了STRICT_TRANS_TABLES严格模式，所以报错了 解决方法是： 如果自己的服务器，有权限修改my.ini的话，打开my.ini，查找 sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION" 修改为 sql-mode="NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION" 然后重启MYSQL 在别人的虚拟空间上当然不可能实现，所以根本的解决方法还是修改自己的数据结构，把非空的字段加上默认值，以后设计数据库要注意这一点，方便程序的移植]]></description>
			<content:encoded><![CDATA[<p>在别的服务器运行我的网站程序的时候，出现了Field 'id' doesn't have a default value 的提示，意思是这个值我没有提交数据，并且数据库结构没有设置默认值，由于对方的mysql服务器开启了STRICT_TRANS_TABLES严格模式，所以报错了</p>
<p>解决方法是：</p>
<p>如果自己的服务器，有权限修改my.ini的话，打开my.ini，查找<br />
sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"</p>
<p>修改为</p>
<p>sql-mode="NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"</p>
<p>然后重启MYSQL</p>
<p>在别人的虚拟空间上当然不可能实现，所以根本的解决方法还是修改自己的数据结构，把非空的字段加上默认值，以后设计数据库要注意这一点，方便程序的移植</p>
<h2 class="title content-title"></h2>
]]></content:encoded>
			<wfw:commentRss>http://www.zui88.com/blog/view-411.html/feed</wfw:commentRss>
		<slash:comments>431</slash:comments>
		</item>
	</channel>
</rss>
