<?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>Dream☆Wing &#187; Mysql</title>
	<atom:link href="http://www.dreamwing.org/category/mysql/feed" rel="self" type="application/rss+xml" />
	<link>http://www.dreamwing.org</link>
	<description></description>
	<lastBuildDate>Sat, 05 Nov 2011 17:23:15 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>修改mysql的root密码方法</title>
		<link>http://www.dreamwing.org/mysql/change-root-password-in-mysql.html</link>
		<comments>http://www.dreamwing.org/mysql/change-root-password-in-mysql.html#comments</comments>
		<pubDate>Thu, 09 Jun 2011 12:24:37 +0000</pubDate>
		<dc:creator>Dream☆Wing</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Mysql]]></category>

		<guid isPermaLink="false">http://www.dreamwing.org/?p=960</guid>
		<description><![CDATA[1. 停止mysqld
2. my.cnf的[mysqld]里加上skip-grant-tables
3. 启动mysqld
4. 以root无密码方式登录mysql
5. UPDATE `mysql`.`user` SET `Password`=PASSWORD(&#8217;newpassword&#8217;) WHERE `User`=&#8217;root&#8217;;
]]></description>
		<wfw:commentRss>http://www.dreamwing.org/mysql/change-root-password-in-mysql.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Field &#8216;file&#8217; doesn&#8217;t have a default value query</title>
		<link>http://www.dreamwing.org/mysql/field-file-doesnt-have-a-default-value-query.html</link>
		<comments>http://www.dreamwing.org/mysql/field-file-doesnt-have-a-default-value-query.html#comments</comments>
		<pubDate>Thu, 15 Oct 2009 10:23:13 +0000</pubDate>
		<dc:creator>Dream☆Wing</dc:creator>
				<category><![CDATA[Mysql]]></category>

		<guid isPermaLink="false">http://www.dreamwing.org/anything/field-file-doesnt-have-a-default-value-query.html</guid>
		<description><![CDATA[file字段not null不是错，错是的mysql不能以strict mode运行
ref: http://dev.mysql.com/doc/refman/5.1/en/server-sql-mode.html#sqlmode_strict_trans_tables
]]></description>
		<wfw:commentRss>http://www.dreamwing.org/mysql/field-file-doesnt-have-a-default-value-query.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>sql导致数据溢出</title>
		<link>http://www.dreamwing.org/mysql/overflow_of_data_from_sql.html</link>
		<comments>http://www.dreamwing.org/mysql/overflow_of_data_from_sql.html#comments</comments>
		<pubDate>Tue, 11 Nov 2008 04:35:01 +0000</pubDate>
		<dc:creator>Dream☆Wing</dc:creator>
				<category><![CDATA[Mysql]]></category>
		<category><![CDATA[溢出]]></category>

		<guid isPermaLink="false">http://www.dreamwing.org/?p=396</guid>
		<description><![CDATA[update cdb_members set digestposts = digestposts-1 where ...

这样对于digestposts（smallint(6) unsigned） = 0时会被设为65535

smallint(6) unsigned：是指16字节无符号变量，从0-65535

刚才我试了一下下面两个语句
update cdb_members set digestposts = -1 where ...
这时数据里面显示为0
update cdb_members set digestposts = digestposts-1 where ...
这时数据里面显示为65535

说明mysql对两种语句的越界处理不相同

所以DZ后台批量取消用户精华的操作需要增加判断恩。。。。
虽然一般来说技术人员使用该功能能避免该问题，但对于不懂技术的编辑来说的话就会导致数据错误了。。
]]></description>
		<wfw:commentRss>http://www.dreamwing.org/mysql/overflow_of_data_from_sql.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mysql之EXPLAIN</title>
		<link>http://www.dreamwing.org/mysql/mysql_explain.html</link>
		<comments>http://www.dreamwing.org/mysql/mysql_explain.html#comments</comments>
		<pubDate>Thu, 16 Oct 2008 03:44:40 +0000</pubDate>
		<dc:creator>Dream☆Wing</dc:creator>
				<category><![CDATA[Mysql]]></category>

		<guid isPermaLink="false">http://www.dreamwing.org/?p=303</guid>
		<description><![CDATA[explain显示了mysql如何使用索引来处理select语句以及连接表。可以帮助选择更好的索引和写出更优化的查询语句。
使用方法，在select语句前加上explain就可以了：
如：explain select surname,first_name form a,b where a.id=b.id
EXPLAIN列的解释：
    * table：显示这一行的数据是关于哪张表的
    * type：这是重要的列，显示连接使用了何种类型。从最好到最差的连接类型为const、eq_reg、ref、range、indexhe和ALL
    * possible_keys：显示可能应用在这张表中的索引。如果为空，没有可能的索引。可以为相关的域从WHERE语句中选择一个合适的语句
    * key：实际使用的索引。如果为NULL，则没有使用索引。很少的情况下，MYSQL会选择优化不足的索引。这种情况下，可以在SELECT语句中使用USE INDEX（indexname）来强制使用一个索引或者用IGNORE INDEX（indexname）来强制MYSQL忽略索引
    * key_len：使用的索引的长度。在不损失精确性的情况下，长度越短越好
    * ref：显示索引的哪一列被使用了，如果可能的话，是一个常数
    * rows：MYSQL认为必须检查的用来返回请求数据的行数
    * Extra：关于MYSQL如何解析查询的额外信息。将在表4.3中讨论，但这里可以看到的坏的例子是Using temporary和Using filesort，意思MYSQL根本不能使用索引，结果是检索会很慢
extra列返回的描述的意义
    * [...]]]></description>
		<wfw:commentRss>http://www.dreamwing.org/mysql/mysql_explain.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

