<?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</title>
	<atom:link href="http://www.ooso.net/tag/mysql/feed" rel="self" type="application/rss+xml" />
	<link>http://www.ooso.net</link>
	<description>Linux + Apache + Mysql + Php + Flash</description>
	<lastBuildDate>Thu, 19 Jan 2012 01:21:44 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>mysql主从同步快速设置</title>
		<link>http://www.ooso.net/archives/547</link>
		<comments>http://www.ooso.net/archives/547#comments</comments>
		<pubDate>Wed, 27 Oct 2010 06:46:52 +0000</pubDate>
		<dc:creator>Volcano</dc:creator>
				<category><![CDATA[mysql]]></category>

		<guid isPermaLink="false">http://www.ooso.net/?p=547</guid>
		<description><![CDATA[记录一个比较简便的mysql的主从同步设置步骤，方便日后使用。
安装环境
centos 5.4
mysql 5.1.xx 采用rpm直接安装

				<span class="readmore"><a href="http://www.ooso.net/archives/547" title="mysql主从同步快速设置">阅读全文（1166字）</a></span>]]></description>
			<content:encoded><![CDATA[<p>记录一个比较简便的mysql的主从同步设置步骤，方便日后使用。</p>
<h2>安装环境</h2>
<li>centos 5.4</li>
<li>mysql 5.1.xx 采用rpm直接安装</li>
<li>xtrabackup 1.2.22 采用rpm直接安装</li>
<h2>1. Master:/etc/my.cnf</h2>
<pre><code>[mysqld]
server-id = 1
log-bin
innodb_flush_log_at_trx_commit=1
sync_binlog=1
datadir=/var/lib/mysql

character-set-server=utf8
init_connect='SET NAMES utf8'</code></pre>
<p>设定了默认字符集为utf8，可以按实际情况取舍这段配置。</p>
<h2>2. Slave:/etc/my.cnf</h2>
<pre><code>[mysqld]
server-id=2
datadir=/var/lib/mysql

character-set-server=utf8
init_connect='SET NAMES utf8'</code></pre>
<h2>3. Master:在master数据库设置用来同步的slave用户权限</h2>
<pre><code>GRANT REPLICATION SLAVE ON *.*
TO '&lt;slave_username&gt;'@'&lt;slave_ip&gt;'
IDENTIFIED BY '&lt;slave_password&gt;';</code></pre>
<h2></h2>
<h2>4. Master:导出数据到slave</h2>
<p>采用xtrabackup来备份mysql，好处是在master的锁表时间很短，在实际的生产环境也可以使用，并且xtrabackup会自动记录同步日志文件的位置。</p>
<pre><code>sudo innobackupex-1.5.1 --stream=tar /tmp/ | ssh &lt;slave_host&gt; "mkdir /tmp/db; tar xfi - -C /tmp/db/"</code></pre>
<p>这个步骤会把master的数据包括表结构整个导出并压缩复制给slave，同时解压到slave的/tmp/db目录下。</p>
<h2>5. Slave:导入数据到slave</h2>
<pre><code>innobackupex-1.5.1 --apply-log /tmp/db
innobackupex-1.5.1 --copy-back /tmp/db
chown -R mysql.mysql /var/lib/mysql/*</code></pre>
<h2>6. Slave:开始同步数据</h2>
<p>查看/var/lib/mysql/xtrabackup_binlog_info，获得日志文件以及position。</p>
<pre><code>CHANGE MASTER TO
MASTER_HOST='&lt;master_host&gt;',
MASTER_USER='&lt;slave_username&gt;',
MASTER_PASSWORD='&lt;slave_password&gt;',
MASTER_LOG_FILE='&lt;see xtrabackup_binlog_info&gt;',
MASTER_LOG_POS=&lt;see xtrabackup_binlog_info&gt;;

START SLAVE;</code></pre>
]]></content:encoded>
			<wfw:commentRss>http://www.ooso.net/archives/547/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>mysql 5.5.0已经可以下载</title>
		<link>http://www.ooso.net/archives/433</link>
		<comments>http://www.ooso.net/archives/433#comments</comments>
		<pubDate>Tue, 15 Dec 2009 23:32:50 +0000</pubDate>
		<dc:creator>Volcano</dc:creator>
				<category><![CDATA[mysql]]></category>

		<guid isPermaLink="false">http://www.ooso.net/?p=433</guid>
		<description><![CDATA[很高兴能够看到这个时候mysql还能出个新版本，mysql 5.5.0是所谓的milestone version，这次带来了一些有趣的东西，按照重要程度（我主观上的）列一下:


支持Semisynchronous Replication，这个是从早期google的semi-sync patch转过来的，能够做到master-slave的半同步复制

				<span class="readmore"><a href="http://www.ooso.net/archives/433" title="mysql 5.5.0已经可以下载">阅读全文（276字）</a></span>]]></description>
			<content:encoded><![CDATA[<p>很高兴能够看到这个时候<a href="/?tag=mysql">mysql</a>还能出个新版本，mysql 5.5.0是所谓的milestone version，这次带来了一些有趣的东西，按照重要程度（我主观上的）列一下:</p>
<ol>
<ul>
<li>支持<a href="http://dev.mysql.com/doc/refman/5.5/en/replication-semisync.html">Semisynchronous Replication</a>，这个是从早期<a href="http://code.google.com/p/google-mysql-tools/wiki/SemiSyncReplicationDesign">google的semi-sync patch</a>转过来的，能够做到master-slave的半同步复制</li>
<li>集成Innodb plugin 1.0.6</li>
<li><a href="http://dev.mysql.com/doc/refman/5.5/en/partitioning-list.html">新的partition语法</a></li>
</ul>
</ol>
<p>这个版本还不适合用在正式环境。想想以后也许可以用mysql mmm + mysql 5.5提供可用性更好的服务，前提是它已经足够稳定，或者是percona版本？</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ooso.net/archives/433/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>mysql的partition与auto_increment</title>
		<link>http://www.ooso.net/archives/519</link>
		<comments>http://www.ooso.net/archives/519#comments</comments>
		<pubDate>Fri, 11 Dec 2009 14:18:34 +0000</pubDate>
		<dc:creator>Volcano</dc:creator>
				<category><![CDATA[mysql]]></category>

		<guid isPermaLink="false">http://www.ooso.net/?p=519</guid>
		<description><![CDATA[mysql 5.1之后，开始新增了partition功能，可以做到对代码透明的情况下进行数据分区。但是从实际使用中来看，限制颇多：


如果用来分区的字段和主键不是同一个，则不能分区

				<span class="readmore"><a href="http://www.ooso.net/archives/519" title="mysql的partition与auto_increment">阅读全文（865字）</a></span>]]></description>
			<content:encoded><![CDATA[<p><a href="/?tag=mysql">mysql</a> 5.1之后，开始新增了partition功能，可以做到对代码透明的情况下进行数据分区。但是从实际使用中来看，限制颇多：</p>
<ol>
<ul>
<li>如果用来分区的字段和主键不是同一个，则不能分区</li>
<li>见很早前的一篇译文<a href="http://www.ooso.net/archives/217">mysql 5.1新功能 －－ 按日期分区</a>，如果查询条件中没有正确利用到分区的字段，那么partition的效果为零</li>
<li>mysql 5.1.31之前的partition功能有较大的bug，会导致自增字段不能正常自增，怎么个不正常法？auto_increment值会非正常增长，突然比当前的最大id小很多，插入数据时导致duplicate key错误。</li>
</ul>
</ol>
<p>这些问题都能凑合着对付过去，但是partition功能和auto_increment似乎是天生的敌人。从使用习惯上来说，我们会把auto_increment字段设置为主键，这个字段要是unique的才比较稳妥，这个情况下如果希望用其它字段来进行分区的话，几乎就成了不可能的任务。以这张表为例：</p>
<pre><code>CREATE TABLE user (
  id int auto_increment PRIMARY KEY,
  uid int,
  foo varchar(32)
) engine=myisam;</code></pre>
<p>这个时候试图以uid进行分区会怎么样？是以怎样的惨淡结局收场？变通的办法是对自增字段做一些调整，从mysql的手册来看，自增字段不一定要设置成主键，仅仅是普通的index也可以，那么把表结构换成下面这个样子，就可以分区成功。</p>
<pre><code>CREATE TABLE user (
  id int auto_increment,
  uid int,
  foo varchar(32),
  index (id)
) engine=innodb PARTITION BY HASH (uid) PARTITIONS 4;</code></pre>
<p>我在实际环境中有一张表达到了几亿条数据，如果要用时下流行的sharding策略，必须在代码上做一些改动，当时偷了点懒直接使用partition功能，用了大半年倒也相安无事。只是分区表占用内存相当的大，如果有其它的表经常出现慢查询耗费服务器资源，那么雪崩效应就出现了，所有的查询都会堵塞变得非常慢。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ooso.net/archives/519/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>关于mysql proxy 0.7.0</title>
		<link>http://www.ooso.net/archives/501</link>
		<comments>http://www.ooso.net/archives/501#comments</comments>
		<pubDate>Sun, 05 Apr 2009 09:12:40 +0000</pubDate>
		<dc:creator>Volcano</dc:creator>
				<category><![CDATA[mysql]]></category>

		<guid isPermaLink="false">http://www.ooso.net/?p=501</guid>
		<description><![CDATA[听说mysql proxy 0.7.0即将发布，正好前些日子从bzr上获取mysql proxy的代码编译过，看看当时bzr的版本号，和现在也差不了多少。在这期间，我又花了一些时间把mysql配置成读写分离，出了不少妖蛾子，由于使用的人不太多，解决问题超费劲——搜索不到有帮助的内容啊。但是我可能是比较幸运的，最后成功的实现了读写分离，目前在开发环境运行的比较稳定，所以有必要做个笔记分享一下。
读写分离脚本的问题
刚启动mysql proxy的时候，经常报错 &#8212; &#8220;Mysql server has gone away&#8221;。我进一步缩小了可能出问题的范围(把环境简化是很重要的查错手段哦！)，比如只连接一个mysql，或者只连接本机的mysql，没有太大帮助，最后是在mysql proxy的日志文件中看到些蛛丝马迹：

				<span class="readmore"><a href="http://www.ooso.net/archives/501" title="关于mysql proxy 0.7.0">阅读全文（1323字）</a></span>]]></description>
			<content:encoded><![CDATA[<p>听说<a href="http://jan.kneschke.de/2009/4/4/mysql-proxy-0-7-0-pre-release">mysql proxy 0.7.0即将发布</a>，正好<a href="http://www.ooso.net/archives/495">前些日子从bzr上获取mysql proxy的代码编译过</a>，看看当时bzr的版本号，和现在也差不了多少。在这期间，我又花了一些时间把mysql配置成读写分离，出了不少妖蛾子，由于使用的人不太多，解决问题超费劲——搜索不到有帮助的内容啊。但是我可能是比较幸运的，最后成功的实现了读写分离，目前在开发环境运行的比较稳定，所以有必要做个笔记分享一下。</p>
<h2>读写分离脚本的问题</h2>
<p>刚启动mysql proxy的时候，经常报错 &#8212; &#8220;Mysql server has gone away&#8221;。我进一步缩小了可能出问题的范围(把环境简化是很重要的查错手段哦！)，比如只连接一个mysql，或者只连接本机的mysql，没有太大帮助，最后是在mysql proxy的日志文件中看到些蛛丝马迹：</p>
<blockquote><p>
(critical) proxy-plugin.c:1367: (connect_server) [string "/usr/local/share/mysql-proxy/r..."]:69: .address is deprecated. Use .src.name or .dst.name instead<br />
(critical) (read_query) [string "/usr/local/share/mysql-proxy/r..."]:179: .address is deprecated. Use .src.name or .dst.name instead<br />
(critical) proxy-plugin.c.1115: I have no server backend, closing connection
</p></blockquote>
<p>在<a href="http://forums.mysql.com/list.php?146">mysql proxy的论坛</a>上看到有人碰到类似的问题，很简单，读写分离的lua脚本还是旧的，0.6.1时代的产物了，更糟糕的是，即便是即将发布的0.7.0，rw-splitting.lua也是旧版本的。lua脚本中的<b>.address</b>需要替换成<b>.src.name</b>或者<b>.dst.name</b>。</p>
<p><b>解决办法</b> —— 下载<a href="http://bazaar.launchpad.net/%7Ediego-fmpwizard/mysql-proxy/bug-43424/download/head%3A/rwsplitting.lua-20090112150705-l9v35osiopsn0nz0-10/rw-splitting.lua">更新之后的rw-splitting.lua</a>，情况会好转。</p>
<h2>使用prepare方法无法获得结果</h2>
<p>我在测试代码中采用php的pdo_mysql，单独连接mysql是毫无问题的，然而配合mysql proxy使用则是屡屡受挫，查询经常没有结果返回，比较随机，从日志中也找不到有帮助的内容。这次没有找到解决办法，所以我绕了过去，在连接mysql的时候使用伪prepare的方式：</p>
<pre><code>$option = array(PDO::ATTR_EMULATE_PREPARES =&gt; 1);</code></pre>
<p>据称emulate方式的性能比prepare要好，所以这也算安慰奖了。</p>
<h2>专门的lua脚本分支</h2>
<p>lua脚本开发滞后，是一个比较严重的问题，所以在邮件组上看到有个新的lua脚本分支出来 —— <a href="https://launchpad.net/mysql-proxy-lua-scripts">https://launchpad.net/mysql-proxy-lua-scripts</a>。希望开发速度能跟上来。</p>
<h2>keepalive参数</h2>
<p>mysql proxy还不算太稳定，偶尔crash我也不觉得惊讶，所以新增的keepalive参数很有用。在proxy启动的时候，加上&#8211;keepalive参数，它便会努力保持proxy的运行状态，停止了也会自动重启。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ooso.net/archives/501/feed</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>在centos 5.2下安装最新的mysql proxy</title>
		<link>http://www.ooso.net/archives/495</link>
		<comments>http://www.ooso.net/archives/495#comments</comments>
		<pubDate>Sat, 14 Mar 2009 14:09:16 +0000</pubDate>
		<dc:creator>Volcano</dc:creator>
				<category><![CDATA[mysql]]></category>
		<category><![CDATA[centos]]></category>

		<guid isPermaLink="false">http://www.ooso.net/?p=495</guid>
		<description><![CDATA[mysql proxy的代码树已经迁移到lauchpad，采用bazaar进行版本管理。参考了一些文档，在centos 5.2下编译安装最新mysql proxy成功。步骤记录如下（在centos 5下应该也适用）：
首先让EPEL (Extra Packages for Enterprise Linux) repository 生效
# rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-2.noarch.rpm

				<span class="readmore"><a href="http://www.ooso.net/archives/495" title="在centos 5.2下安装最新的mysql proxy">阅读全文（1677字）</a></span>]]></description>
			<content:encoded><![CDATA[<p>mysql proxy的代码树已经迁移到lauchpad，采用bazaar进行版本管理。参考了一些文档，在centos 5.2下编译安装最新<a href="/?tag=mysql">mysql</a> proxy成功。步骤记录如下（在centos 5下应该也适用）：</p>
<p>首先让EPEL (Extra Packages for Enterprise Linux) repository 生效</p>
<pre><code># rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-2.noarch.rpm</code></pre>
<p>确定这些包已经安装：GNU Autotools, flex, pkg-config, bazaar, MySQL client libraries</p>
<pre><code># yum install autoconf automake libtool flex pkgconfig bzr mysql-devel</code></pre>
<p>centos下自带的libevent版本超老，这个没有别的办法，只能自己重新编译，版本需要在1.4.0以上，越高越好</p>
<pre><code>$ wget http://monkey.org/~provos/libevent-1.4.9-stable.tar.gz
$ tar zvfx libevent-1.4.9-stable.tar.gz
$ cd libevent-1.4.9-stable
$ ./configure
$ make
# make install</code></pre>
<p>centos自带的glib版本也比较老，mysql proxy 0.7.0以上需要glib2 2.16.0以上才能编译成功，因此不得不重新编译glib</p>
<pre><code>$ wget http://ftp.gnome.org/pub/gnome/sources/glib/2.18/glib-2.18.4.tar.gz
$ tar zvfx glib-2.18.4.tar.gz
$ cd glib-2.18.4
$ ./configure
$ make
# make install</code></pre>
<p>编译安装lua 5.1</p>
<pre><code>$ wget http://www.lua.org/ftp/lua-5.1.4.tar.gz
$ tar zvfx lua-5.1.4.tar.gz
$ cd lua-5.1.4
$ vi src/Makefile</code></pre>
<p>在CFLAGS里加上-fPIC，因为我在64位机上编译出现了“relocations”错误</p>
<pre><code>$ make linux
# make install
# cp etc/lua.pc /usr/local/lib/pkgconfig/</code></pre>
<p><strong>重要：让pkg-config找到自己编译的库在哪里 </strong></p>
<pre><code>$ export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig</code></pre>
<p>最后，从bazaar中检出最新的mysql-proxy源文件进行编译：</p>
<pre><code>$ bzr branch lp:mysql-proxy
$ cd mysql-proxy
$ ./autogen.sh
$ ./configure
$ make
# make install</code></pre>
<p>编译完成，可以检查一下最终结果：</p>
<pre><code># mysql-proxy -V</code></pre>
<pre><code>mysql-proxy 0.7.0
  glib2: 2.18.4
  libevent: 1.4.9-stable
  admin: 0.7.0
  proxy: 0.7.0</code></pre>
<p>配置启动脚本，在系统启动时运行mysql-proxy</p>
<pre><code>cd /etc/init.d
wget http://customcode.googlecode.com/files/mysql-proxy
chmod 0755 /etc/init.d/mysql-proxy
chkconfig mysql-proxy on</code></pre>
<p>增加运行参数</p>
<pre><code>cat &gt;/etc/sysconfig/mysql-proxy</code></pre>
<pre><code># Options to mysql-proxy
# do not remove --daemon
PROXY_OPTIONS="--daemon"</code></pre>
<p>CTRL+D保存，然后就可以使用以下命令启动|停止mysql-proxy</p>
<pre><code>/etc/init.d/mysql-proxy start|stop</code></pre>
<p>参考文档：<br />
<a href="http://blog.zhuzhaoyuan.com/2009/02/how-to-compile-and-install-mysql-proxy-from-bazaar-on-centos-52/">How to Compile and Install MySQL Proxy from Bazaar on CentOS 5.2</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.ooso.net/archives/495/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>php 5.3带来了什么(二)</title>
		<link>http://www.ooso.net/archives/470</link>
		<comments>http://www.ooso.net/archives/470#comments</comments>
		<pubDate>Sun, 21 Sep 2008 06:44:53 +0000</pubDate>
		<dc:creator>Volcano</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[mysql]]></category>

		<guid isPermaLink="false">http://www.ooso.net/index.php/archives/470</guid>
		<description><![CDATA[接上文
性能提升
php 5.3的总体性能提升了5 &#8211; 15%


				<span class="readmore"><a href="http://www.ooso.net/archives/470" title="php 5.3带来了什么(二)">阅读全文（1217字）</a></span>]]></description>
			<content:encoded><![CDATA[<p>接上文</p>
<h2>性能提升</h2>
<p>php 5.3的总体性能提升了5 &#8211; 15%</p>
<ul>
<li>md5()快了10-15%</li>
<li>Better stack implementation in the engine</li>
<li>Constants移到read-only内存里</li>
<li>exception处理过程改进(简化，opcodes更少)</li>
<li>(require/include)_once改进，去掉重复open</li>
<li>Smaller binary size &#038; startup size with gcc4</li>
</ul>
<h2>新语言特性</h2>
<h3>__DIR__</h3>
<p>在5.3以前，为了获得当前脚本的目录，需要一次函数调用</p>
<pre><code>echo dirname(__FILE__); // &lt; PHP 5.3</code></pre>
<p>在5.3，只需要一个魔术常量__DIR__就解决了。</p>
<pre><code>echo __DIR__; // &gt;= PHP 5.3</code></pre>
<h3>?:操作符</h3>
<p>便捷的<b>?:</b>操作符，可以从两个值/表达式中快速取得非空值。</p>
<pre><code>$a = true ?: false; // true
$a = false ?: true; // true
$a = "" ?: 1; // 1
$a = 0 ?: 2; // 2
$a = array() ?: array(1); // array(1);
$a = strlen("") ?: strlen("a"); // 1</code></pre>
<h3>__callStatic()</h3>
<p>新增了魔术方法__callStatic，功能和__call类似，但是仅对static方法有效。</p>
<pre><code>class helper {
        static function __callStatic($name, $args) {
                echo $name.'('.implode(',', $args).')';
        }
}
helper::test("foo","bar"); // test(foo,bar)</code></pre>
<h3>动态调用static方法</h3>
<p>动态的调用静态方法？动静结合。</p>
<pre><code>class helper {
        static function foo() { echo __METHOD__; }
}
$a = "helper";
$b = "foo";
$a::$b(); // helper::foo</code></pre>
<h3>Late Static Binding</h3>
<p>不知道怎么译，可能留个原文更容易理解。静态方法的事件处理时机有变化，以前是在编译期处理，现在是执行期间处理。</p>
<p>在php 5.3之前，下面的代码会输出一个A，但是这不是咱们要的，whoami方法已经在class B中重新定义，它本该输出B才符合咱们想当然的思维。</p>
<pre><code>class A {
   public static function whoami() {
      echo __CLASS__;
   }
   public static function identity() {
     self::whoami();
   }
}
class B extends A {
   public static function whoami() {
      echo __CLASS__;
   }
}
B::identity(); // A &lt;-- PHP &lt; 5.3</code></pre>
<p>下面代码中使用了<b>static::whoami()</b>来调用静态方法。php 5.3之后，由于__CLASS__是在执行期被处理，那么这个例子中能顺利抓到class B。</p>
<pre><code>class A {
   public static function whoami() {
      echo __CLASS__;
   }
   public static function identity() {
      static::whoami();
   }
}
class B extends A {
   public static function whoami() {
      echo __CLASS__;
   }
}
B::identity(); // B &lt;-- &gt;= PHP 5.3</code></pre>
<h2>mysqlnd</h2>
<p>见<a href="http://www.ooso.net/index.php/archives/464">mysqlnd成为php 5.3中的默认mysql驱动</a></p>
<p>但是PDO_MySQL暂时还不支持mysqlnd，目前只有mysql(i)扩展可以用到</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ooso.net/archives/470/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>mysql proxy的常见问题</title>
		<link>http://www.ooso.net/archives/467</link>
		<comments>http://www.ooso.net/archives/467#comments</comments>
		<pubDate>Sat, 20 Sep 2008 09:34:26 +0000</pubDate>
		<dc:creator>Volcano</dc:creator>
				<category><![CDATA[mysql]]></category>

		<guid isPermaLink="false">http://www.ooso.net/index.php/archives/467</guid>
		<description><![CDATA[最近试用mysql proxy，遇到若干问题，好在一一找到了解决方案，列出来备忘。这次使用的版本是0.6.x，也许新版本就没有这些问题了。
无法通过mysql proxy连接mysql
在host,password正确的情况下，也会遇到无法连接mysql的情况，可以查查mysql server是不是使用了old_password，检查my.cnf里面是不是有
old_password = 1

				<span class="readmore"><a href="http://www.ooso.net/archives/467" title="mysql proxy的常见问题">阅读全文（876字）</a></span>]]></description>
			<content:encoded><![CDATA[<p>最近试用<a href="/?tag=mysql">mysql</a> proxy，遇到若干问题，好在一一找到了解决方案，列出来备忘。这次使用的版本是0.6.x，也许新版本就没有这些问题了。</p>
<h2>无法通过mysql proxy连接mysql</h2>
<p>在host,password正确的情况下，也会遇到无法连接mysql的情况，可以查查mysql server是不是使用了old_password，检查my.cnf里面是不是有
<pre><code>old_password = 1</code></pre>
<p>有的数据库是从老版本升级上来的，所以会开启这个选项，mysql proxy不支持old_password。另外也可以通过查看密码长度的方式来判断:</p>
<pre><code>select length(password) from mysql.user</code></pre>
<p>如果长度为16位则是old_password无疑。</p>
<h2>字符乱码</h2>
<p>通过proxy连上数据库之后，查到的字符串始终是乱码，即便手工执行了<b>set names &#8216;utf8&#8242;</b>也没有效果。</p>
<p>解决办法，mysql server必须设置</p>
<pre><code>[mysqld]
skip-character-set-client-handshake
init-connect='SET NAMES utf8'
default-character-set=utf8</code></pre>
<h2>一台mysql slave当掉之后，mysql proxy会报错导致全部的mysql无法连接</h2>
<p>安装了mysql proxy实现读写分离，有master x 1, slave x 2。为了测试failover，停掉了一个slave，然后mysql proxy会一直报错，提示无法连接。这个情况比单点的mysql还糟糕，挂掉一个就全挂掉！mysql的工程师给提供了一段代码，替换掉<b>src/network-mysqld-proxy.c</b>的<b>NETWORK_MYSQLD_PLUGIN_PROTO</b>函数可以解决这个问题。</p>
<p>代码比较长，直接附上下载地址： <a href="http://customcode.googlecode.com/files/network-mysqld-proxy-function.c">network-mysqld-proxy-function.c</a></p>
<h2>定期crash</h2>
<p>这个问题也很糟糕，mysql proxy经常会自己悄悄的停止工作，所幸时间间隔很长。猜想是有内存泄漏的问题存在，希望以后的版本能解决。</p>
<p>我采用的解决办法就是晚上定期重启它。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ooso.net/archives/467/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>mysqlnd成为php 5.3中的默认mysql驱动</title>
		<link>http://www.ooso.net/archives/464</link>
		<comments>http://www.ooso.net/archives/464#comments</comments>
		<pubDate>Wed, 06 Aug 2008 15:15:03 +0000</pubDate>
		<dc:creator>Volcano</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[mysql]]></category>

		<guid isPermaLink="false">http://www.ooso.net/?p=464</guid>
		<description><![CDATA[mysqlnd成为php 5.3中的默认mysql驱动，它有如下优点：

mysqlnd更容易编译: 因为它是php源码树的一个组成部分
mysqlnd和php内部机制结合更紧密，是优化过的mysql驱动

				<span class="readmore"><a href="http://www.ooso.net/archives/464" title="mysqlnd成为php 5.3中的默认mysql驱动">阅读全文（255字）</a></span>]]></description>
			<content:encoded><![CDATA[<p>mysqlnd成为php 5.3中的默认mysql驱动，它有如下优点：</p>
<ul>
<li>mysqlnd更容易编译: 因为它是php源码树的一个组成部分</li>
<li>mysqlnd和php内部机制结合更紧密，是优化过的mysql驱动</li>
<li>mysqlnd更节省内存，从测试结果来看，比传统的mysql扩展节省40%的内存</li>
<li>mysqlnd更快</li>
<li>mysqlnd提供了丰富的性能统计功能</li>
<li>mysqlnd使用了PHP license以避免不必要的版权纠纷</li>
</ul>
<p>这个改动应同时对mysql和pdo_mysql扩展生效。</p>
<h3>mysqlnd是什么</h3>
<p><a href="http://blogs.mysql.com/kaj/2006/10/25/69/">mysqlnd</a>是<a href="/?tag=mysql">mysql</a>原装的php驱动</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ooso.net/archives/464/feed</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>用mysql触发器自动更新memcache</title>
		<link>http://www.ooso.net/archives/436</link>
		<comments>http://www.ooso.net/archives/436#comments</comments>
		<pubDate>Wed, 09 Jul 2008 06:41:39 +0000</pubDate>
		<dc:creator>Volcano</dc:creator>
				<category><![CDATA[mysql]]></category>
		<category><![CDATA[memcache]]></category>

		<guid isPermaLink="false">http://www.ooso.net/?p=436</guid>
		<description><![CDATA[mysql 5.1支持触发器以及自定义函数接口(UDF)的特性，如果配合libmemcache以及Memcached Functions for MySQL，就能够实现memcache的自动更新。简单记录一下安装测试步骤。
安装步骤

安装memcached,这个步骤很简单，随处可见

				<span class="readmore"><a href="http://www.ooso.net/archives/436" title="用mysql触发器自动更新memcache">阅读全文（1451字）</a></span>]]></description>
			<content:encoded><![CDATA[<p>mysql 5.1支持触发器以及自定义函数接口(UDF)的特性，如果配合libmemcache以及Memcached Functions for MySQL，就能够实现<a href="/?tag=memcache">memcache</a>的自动更新。简单记录一下安装测试步骤。</p>
<h3>安装步骤</h3>
<ul>
<li>安装<a href="http://www.danga.com/memcached/">memcached</a>,这个步骤很简单，随处可见</li>
<li>安装<a href="http://www.mysql.com">mysql server 5.1RC</a>，安装办法也很大众，不废话了</li>
<li>编译<a href="http://hg.tangent.org/libmemcached/">libmemcached</a>，解压后安装即可
<pre><code>./configure; make; make install</code></pre>
</li>
<li>编译Memcached Functions for MySQL，在<a href="http://download.tangent.org/">http://download.tangent.org/</a>找一个最新的版本下载就是，
<pre><code>./configure --with-mysql=/usr/local/mysql/bin/mysql_config --libdir=/usr/local/mysql/lib/mysql/
make
make install</code></pre>
</li>
<li>接下来有两个办法让Memcached Functions for MySQL在mysql中生效
<ul>
<li>在mysql的shell中执行memcached_functions_mysql源码目录下的sql/install_functions.sql，这会把memcache function作为UDF加入mysql</li>
<li>运行memcached_functions_mysql源码目录下的utils/install.pl，这是一个perl脚本，作用同上一条</li>
</ul>
</li>
</ul>
<h3>测试memcache function</h3>
<p>以下测试脚本摘自memcached_functions_mysql的源码目录，有兴趣可以试试</p>
<pre><code>drop table if exists urls;
create table urls (
  id int(3) not null,
  url varchar(64) not null default '',
  primary key (id)
  );

select memc_servers_set('localhost:11211');
select memc_set('urls:sequence', 0);

DELIMITER |

DROP TRIGGER IF EXISTS url_mem_insert;
CREATE TRIGGER url_mem_insert
BEFORE INSERT ON urls
FOR EACH ROW BEGIN
    SET NEW.id= memc_increment('urls:sequence');
    SET @mm= memc_set(concat('urls:',NEW.id), NEW.url);
END |

DELIMITER ;

insert into urls (url) values ('http://google.com');
insert into urls (url) values ('http://www.ooso.net/index.php');
insert into urls (url) values ('http://www.ooso.net/');
insert into urls (url) values ('http://slashdot.org');
insert into urls (url) values ('http://mysql.com');
select * from urls;

select memc_get('urls:1');
select memc_get('urls:2');
select memc_get('urls:3');
select memc_get('urls:4');
select memc_get('urls:5');</code></pre>
]]></content:encoded>
			<wfw:commentRss>http://www.ooso.net/archives/436/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>混合使用SQL和shell命令</title>
		<link>http://www.ooso.net/archives/439</link>
		<comments>http://www.ooso.net/archives/439#comments</comments>
		<pubDate>Tue, 01 Jul 2008 01:19:57 +0000</pubDate>
		<dc:creator>Volcano</dc:creator>
				<category><![CDATA[mysql]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[sql]]></category>

		<guid isPermaLink="false">http://www.ooso.net/index.php/archives/439</guid>
		<description><![CDATA[mysql下可以用批处理模式运行SQL，比如:
shell&#62; mysql -h host -u user -p &#60; batch-file.sql
Enter password: ********
但是平常往往需要在执行sql的同时，运行一些shell脚本进行进一步计算，保存日志之类的。这个可以靠mysql的system命令来实现，例如：

				<span class="readmore"><a href="http://www.ooso.net/archives/439" title="混合使用SQL和shell命令">阅读全文（603字）</a></span>]]></description>
			<content:encoded><![CDATA[<p>mysql下可以用批处理模式运行SQL，比如:</p>
<pre><code>shell&gt; mysql -h host -u user -p &lt; batch-file.sql
Enter password: ********</code></pre>
<p>但是平常往往需要在执行sql的同时，运行一些shell脚本进行进一步计算，保存日志之类的。这个可以靠<a href="/?tag=mysql">mysql</a>的system命令来实现，例如：</p>
<pre><code># Mixing shell commands and SQL queries in batch mode- demo script
use test;
#INSTALL PLUGIN example SONAME 'ha_example.so'; #Ignore statement
system cp /tmp/mysqld.trace logs/init.trace # Shell commands prefixed with a 'system'
create table new4(num integer) engine=EXAMPLE;
system cp /tmp/mysqld.trace logs/after_create.trace # Shell commands prefixed with a 'system'
system diff logs/init.trace logs/after_create.trace # Shell commands prefixed with a 'system'</code></pre>
<h3>注意</h3>
<ul>
<li>system命令只在类unix操作系统上有效。</li>
<li>可以在存储过程中使用system。</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.ooso.net/archives/439/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>在命令行里执行mysql的sql</title>
		<link>http://www.ooso.net/archives/429</link>
		<comments>http://www.ooso.net/archives/429#comments</comments>
		<pubDate>Mon, 23 Jun 2008 03:05:39 +0000</pubDate>
		<dc:creator>Volcano</dc:creator>
				<category><![CDATA[mysql]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[sql]]></category>

		<guid isPermaLink="false">http://www.ooso.net/?p=429</guid>
		<description><![CDATA[平常执行sql，需要登录到mysql的shell下，然后再执行。比如：
$ /usr/bin/mysql -u root
mysql&#62; select * from users;
但是如果写一点简单的脚本，也可以在命令行下直接运行sql并显示结果，比如：

				<span class="readmore"><a href="http://www.ooso.net/archives/429" title="在命令行里执行mysql的sql">阅读全文（204字）</a></span>]]></description>
			<content:encoded><![CDATA[<p>平常执行sql，需要登录到<a href="/?tag=mysql">mysql</a>的shell下，然后再执行。比如：</p>
<pre><code>$ /usr/bin/mysql -u root
mysql&gt; select * from users;</code></pre>
<p>但是如果写一点简单的脚本，也可以在命令行下直接运行sql并显示结果，比如：</p>
<pre><code>$ cat executemysql.sh
#!/bin/sh

qry=$1;

echo "Executing the following query"
echo "$qry"

mysql -u root &lt;&lt; eof
$qry
eof</code></pre>
<p>运行一下:</p>
<pre><code>$ ./executemysql.sh "select id,name,age from test.users limit 2"
Executing the following query
select id,name,age from test.users limit 2
id name age
3 john 20
4 tom 21</code></pre>
<p>原文：<a href="http://unstableme.blogspot.com/2008/06/execute-mysql-from-bash-script.html">Execute mysql from bash script</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.ooso.net/archives/429/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PDO_MYSQL的一些预定义常量</title>
		<link>http://www.ooso.net/archives/389</link>
		<comments>http://www.ooso.net/archives/389#comments</comments>
		<pubDate>Wed, 09 Apr 2008 00:38:12 +0000</pubDate>
		<dc:creator>Volcano</dc:creator>
				<category><![CDATA[mysql]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[pdo]]></category>
		<category><![CDATA[utf-8]]></category>

		<guid isPermaLink="false">http://www.ooso.net/?p=389</guid>
		<description><![CDATA[PDO_MYSQL是PHP Data Objects (PDO) interface的一个mysql扩展。仔细看看php手册上面，其实还是有些有趣的参数可供使用，例如：
PDO::MYSQL_ATTR_INIT_COMMAND  (integer)
Command to execute when connecting to the MySQL server. Will automatically be re-executed when reconnecting.
当我使用PDO_MYSQL连上mysql以后，可以利用这个参数自动执行一些QUERY。最常见的使用场合是连接mysql使用utf-8字符集:

				<span class="readmore"><a href="http://www.ooso.net/archives/389" title="PDO_MYSQL的一些预定义常量">阅读全文（425字）</a></span>]]></description>
			<content:encoded><![CDATA[<p>PDO_MYSQL是<a href="/?tag=pdo">PHP Data Objects (PDO) interface</a>的一个mysql扩展。仔细看看php手册上面，其实还是有些有趣的参数可供使用，例如：</p>
<h3>PDO::MYSQL_ATTR_INIT_COMMAND  (integer)</h3>
<blockquote><p>Command to execute when connecting to the MySQL server. Will automatically be re-executed when reconnecting.</p></blockquote>
<p>当我使用PDO_MYSQL连上mysql以后，可以利用这个参数自动执行一些QUERY。最常见的使用场合是连接mysql使用<a href="/index.php?tag=utf-8">utf-8</a>字符集:</p>
<pre><code>$db = new PDO("mysql:dbname=dbname", "user", "password",
	array(PDO::MYSQL_ATTR_INIT_COMMAND =&gt; "SET NAMES 'utf8'"));</code></pre>
<p>以上代码会在连上mysql之后马上执行sql:</p>
<pre><code>set names 'utf8';</code></pre>
]]></content:encoded>
			<wfw:commentRss>http://www.ooso.net/archives/389/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Sun今日宣布收购Mysql</title>
		<link>http://www.ooso.net/archives/377</link>
		<comments>http://www.ooso.net/archives/377#comments</comments>
		<pubDate>Wed, 16 Jan 2008 15:30:21 +0000</pubDate>
		<dc:creator>Volcano</dc:creator>
				<category><![CDATA[mysql]]></category>

		<guid isPermaLink="false">http://www.ooso.net/index.php/archives/377</guid>
		<description><![CDATA[Sun公司(NASDAQ: JAVA) 今日发表声明称，出资10亿$收购Mysql AB，希望能够籍此在数据库市场分得一大杯羹。现如今，已经有相当一部分大公司使用mysql，比如Facebook, Google, Nokia, Baidu and China Mobile，mysql作为一个open source databases，取得这样的成绩实属不易。Sun的这一收购行为，不仅能在数据库市场同oracle,microsoft以及ibm形成有力竞争，更能和它的其它开源产品一起，巩固Sun在开源世界的地位。

				<span class="readmore"><a href="http://www.ooso.net/archives/377" title="Sun今日宣布收购Mysql">阅读全文（924字）</a></span>]]></description>
			<content:encoded><![CDATA[<p>Sun公司(NASDAQ: JAVA) 今日发表声明称，出资10亿$收购Mysql AB，希望能够籍此在数据库市场分得一大杯羹。现如今，已经有相当一部分大公司使用mysql，比如Facebook, Google, Nokia, Baidu and China Mobile，<a href="/index.php?tag=mysql">mysql</a>作为一个open source databases，取得这样的成绩实属不易。Sun的这一收购行为，不仅能在数据库市场同oracle,microsoft以及ibm形成有力竞争，更能和它的其它开源产品一起，巩固Sun在开源世界的地位。</p>
<blockquote><p>SANTA CLARA, CA January 16, 2008 Sun Microsystems, Inc. (NASDAQ: JAVA) today announced it has entered into a definitive agreement to acquire MySQL AB, an open source icon and developer of one of the world&#8217;s fastest growing open source databases for approximately $1 billion in total consideration. The acquisition accelerates Sun&#8217;s position in enterprise IT to now include the $15 billion database market. Today&#8217;s announcement reaffirms Sun&#8217;s position as the leading provider of platforms for the Web economy and its role as the largest commercial open source contributor.</p></blockquote>
<p>Mysql作为LAMP黄金组合中的M，实在功不可没，它的易用性以及良好表现给许多php应用提供了强劲的动力。但不知从此以后，LAMP黄金组合是否还能风光再现（或者该换成LAPP了？）。</p>
<p>原文：<a  href="http://www.sun.com/aboutsun/pr/2008-01/sunflash.20080116.1.xml">Sun Microsystems Announces Agreement to Acquire MySQL, Developer of the World&#8217;s Most Popular Open Source Database</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.ooso.net/archives/377/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>MySQL Proxy的Alpha版本发布</title>
		<link>http://www.ooso.net/archives/366</link>
		<comments>http://www.ooso.net/archives/366#comments</comments>
		<pubDate>Thu, 02 Aug 2007 00:40:38 +0000</pubDate>
		<dc:creator>Volcano</dc:creator>
				<category><![CDATA[mysql]]></category>

		<guid isPermaLink="false">http://www.ooso.net/index.php/archives/366</guid>
		<description><![CDATA[MySQL Proxy的Alpha版本发布。下面是官方的介绍。
What is MySQL Proxy?
MySQL Proxy is a simple program that sits between your client and MySQL server(s) that can monitor, analyze or transform their communication. Its flexibility allows for unlimited uses; common ones include: load balancing; failover; query analysis; query filtering and modification; and many more. 

				<span class="readmore"><a href="http://www.ooso.net/archives/366" title="MySQL Proxy的Alpha版本发布">阅读全文（442字）</a></span>]]></description>
			<content:encoded><![CDATA[<p><a href="http://forge.mysql.com/wiki/MySQL_Proxy">MySQL Proxy</a>的Alpha版本发布。下面是官方的介绍。</p>
<blockquote><p>What is <a href="/index.php?tag=mysql">MySQL</a> Proxy?</p>
<p>MySQL Proxy is a simple program that sits between your client and MySQL server(s) that can monitor, analyze or transform their communication. Its flexibility allows for unlimited uses; common ones include: load balancing; failover; query analysis; query filtering and modification; and many more. </p></blockquote>
<p>看起来，这个东西能做负载均衡，故障恢复以及query过滤之类事情，如果性能很好，bug少少的话，等它的正式版发布后，我会考虑拿它来做些事情，毕竟，这些都是php开发者经常会要面对的事情。期待！！</p>
<ul>
<h1>关于mysql proxy的资源</h1>
<li>下载<a href="http://dev.mysql.com/downloads/mysql-proxy/0.5.html">mysql proxy</a></li>
<li><a href="http://www.oreillynet.com/pub/a/databases/2007/07/12/getting-started-with-mysql-proxy.html">mysql proxy的入门帮助文章</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.ooso.net/archives/366/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>几张关于php的小图</title>
		<link>http://www.ooso.net/archives/314</link>
		<comments>http://www.ooso.net/archives/314#comments</comments>
		<pubDate>Sat, 14 Jul 2007 00:18:45 +0000</pubDate>
		<dc:creator>Volcano</dc:creator>
				<category><![CDATA[mysql]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[postgresql]]></category>

		<guid isPermaLink="false">http://www.ooso.net/index.php/archives/314</guid>
		<description><![CDATA[首先贴两张php的小卡通，不是太喜欢美式风格的画风。

这张漫画是一头大象正在烧烤海豚。php的传统logo是一头大象，而mysql一贯是以海豚作为标志的，那么这幅图说的是php化身的大象正在大力烧烤mysql dophin？
其实是PostgreSQL在烘烤可怜的Mysql，面目憎狞.
]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.elroubio.net/nouveaute/phpinup_gpl_4.jpg" alt="php beauty" /></p>
<p><img src="http://www.elroubio.net/nouveaute/phpinup_gpl_3.jpg" alt="php beauty" /></p>
<p>首先贴两张php的小卡通，不是太喜欢美式风格的画风。</p>
<p><img src="http://sean.chittenden.org/programming/postgresql/mammoth_versus_dolphin_500.jpg" alt="dolphin mysql" /></p>
<p>这张漫画是一头大象正在烧烤海豚。php的传统logo是一头大象，而mysql一贯是以海豚作为标志的，那么这幅图说的是php化身的大象正在大力烧烤mysql dophin？</p>
<p>其实是PostgreSQL在烘烤可怜的<a href="index.php?tag=mysql">Mysql</a>，面目憎狞.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ooso.net/archives/314/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>MYSQL的FOUND_ROWS()函数</title>
		<link>http://www.ooso.net/archives/342</link>
		<comments>http://www.ooso.net/archives/342#comments</comments>
		<pubDate>Mon, 02 Jul 2007 23:45:34 +0000</pubDate>
		<dc:creator>Volcano</dc:creator>
				<category><![CDATA[mysql]]></category>

		<guid isPermaLink="false">http://www.ooso.net/index.php/archives/342</guid>
		<description><![CDATA[UPDATE:FOUND_ROWS()函数貌似还存在一些问题，见http://bugs.mysql.com/bug.php?id=18454
mysql 4.1中新增了FOUND_ROWS()函数，这个函数的说明是这样的：
For a SELECT with a LIMIT clause, the number of rows that would be returned were there no LIMIT clause
A SELECT statement may include a LIMIT clause to restrict the number of rows the server returns to the client. In some cases, it is desirable to know how many rows the statement would have returned without the LIMIT, but without running the statement again. To obtain this row count, include a SQL_CALC_FOUND_ROWS option in the SELECT statement, and then invoke FOUND_ROWS() afterward:

				<span class="readmore"><a href="http://www.ooso.net/archives/342" title="MYSQL的FOUND_ROWS()函数">阅读全文（763字）</a></span>]]></description>
			<content:encoded><![CDATA[<p>UPDATE:FOUND_ROWS()函数貌似还存在一些问题，见<a href="http://bugs.mysql.com/bug.php?id=18454">http://bugs.mysql.com/bug.php?id=18454</a></p>
<p><a href="http://www.mysql.com">mysql</a> 4.1中新增了FOUND_ROWS()函数，这个函数的说明是这样的：</p>
<blockquote><p>For a SELECT with a LIMIT clause, the number of rows that would be returned were there no LIMIT clause</p>
<p>A SELECT statement may include a LIMIT clause to restrict the number of rows the server returns to the client. In some cases, it is desirable to know how many rows the statement would have returned without the LIMIT, but without running the statement again. To obtain this row count, include a SQL_CALC_FOUND_ROWS option in the SELECT statement, and then invoke FOUND_ROWS() afterward:</p></blockquote>
<p>比如说有段sql需要取出一张表的前10行，同时又需要取出符合条件的总数。这在某些翻页操作中很常见</p>
<pre><code>SELECT SQL_CALC_FOUND_ROWS * FROM tbl_name
WHERE id &gt; 100 LIMIT 10;</code></pre>
<p>在上一查询之后，你只需要用FOUND_ROWS()就能获得查询总数，这个数目是抛掉了LIMIT之后的结果数:</p>
<pre><code>SELECT FOUND_ROWS();</code></pre>
<p>其中第一个sql里面的<strong>SQL_CALC_FOUND_ROWS</strong>不可省略，它表示需要取得结果数，也是后面使用FOUND_ROWS()函数的铺垫。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ooso.net/archives/342/feed</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>php 5.2 + pdo_mysql安装</title>
		<link>http://www.ooso.net/archives/270</link>
		<comments>http://www.ooso.net/archives/270#comments</comments>
		<pubDate>Sat, 06 Jan 2007 04:17:13 +0000</pubDate>
		<dc:creator>Volcano</dc:creator>
				<category><![CDATA[mysql]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[pdo]]></category>

		<guid isPermaLink="false">http://www.ooso.net/index.php/archives/270</guid>
		<description><![CDATA[这天在一台redhat的机器上安装php 5.2+pdo_mysql,走了些弯路,浪费了不少时间.记录一下:
首先我按照之前记录的手册安装php,参数上有些变化,configure参数增加了&#8211;with-pdo=shared &#8211;with-pdo-mysql=shared
最后得到一些错误提示:
checking for MySQL support for PDO... yes, shared

				<span class="readmore"><a href="http://www.ooso.net/archives/270" title="php 5.2 + pdo_mysql安装">阅读全文（750字）</a></span>]]></description>
			<content:encoded><![CDATA[<p>这天在一台redhat的机器上安装<a href="http://www.ooso.net/category/php/">php</a> 5.2+pdo_mysql,走了些弯路,浪费了不少时间.记录一下:</p>
<blockquote><p>首先我按照之前<a href="http://www.ooso.net/lamp/">记录的手册安装php</a>,参数上有些变化,configure参数增加了&#8211;with-pdo=shared &#8211;with-pdo-mysql=shared</p></blockquote>
<p>最后得到一些错误提示:</p>
<pre><code>checking for MySQL support for PDO... yes, shared
checking for mysql_config... /usr/bin/mysql_config
./configure: line 3038: -e: command not found
./configure: line 3039: -e: command not found
checking for mysql_query in -lmysqlclient... no
configure: error: mysql_query missing!?</code></pre>
<p>于是暂时去掉了pdo-mysql模块的安装,直接安装pecl.php.net上最新的PDO_MYSQL</p>
<pre><code>tar -xf PDO_MYSQL.tar
cd PDO_MYSQL-1.0.1
phpize
./configure</code></pre>
<p>仍然出现之前的错误提示.很郁闷,在google上搜索了一下,有个最粗鲁最暴力的办法就是直接修改configure,绕过mysql_query的检测,这样能够编译成功,但是使用的时候调用pdo_mysql模块失败.</p>
<p>偶在这个问题上是卡了很久,在google的搜索结果里一个个比对,最后一个比较有建设性的提示是让俺回去查glibc的版本.</p>
<pre><code>rpm -qa|grep glibc</code></pre>
<p>这样看到这台机器上的glibc版本是2.3,而我下载安装的mysql却是for glibc 2.2,难怪会编译失败. 安装对应版本的<a href="http://www.ooso.net/index.php/archives/category/mysql/">mysql</a>之后问题解决.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ooso.net/archives/270/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>wordpress迁移</title>
		<link>http://www.ooso.net/archives/224</link>
		<comments>http://www.ooso.net/archives/224#comments</comments>
		<pubDate>Sun, 20 Aug 2006 02:16:26 +0000</pubDate>
		<dc:creator>Volcano</dc:creator>
				<category><![CDATA[mysql]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[phpmyadmin]]></category>

		<guid isPermaLink="false">http://www.ooso.net/index.php/archives/224</guid>
		<description><![CDATA[前一阵服务器出了些小问题，因此不得不将现有的wordpress做一备份迁移。好在迁移之后还算幸运，整个过程比较顺利，因此现在系统又开始跑起来了。你可能会觉得迁移不是什么太麻烦的事情，不过对于一个几年没挪过窝，东西又烂又多，数据库打包都有8m，虚拟主机权限很少的人来说，这可是一档子大事情。
mysql 4 to mysql 4.1
首先面对的问题，是虚拟主机上的数据库又生了，4.0跳到4.1，老江湖都知道，mysql 4.1新增了字符集，一个没弄好就是页面乱码伺候。
另外一个问题，是前面提过的，原来的数据库用phpmyadmin打包出来，有8M，再用phpmyadmin导入是不用指望，在没有shell权限的情况下，要把这个数据导进去也挺麻烦。

				<span class="readmore"><a href="http://www.ooso.net/archives/224" title="wordpress迁移">阅读全文（575字）</a></span>]]></description>
			<content:encoded><![CDATA[<p>前一阵服务器出了些小问题，因此不得不将现有的<a href="http://www.ooso.net/index.php/archives/category/wordpress/">wordpress</a>做一备份迁移。好在迁移之后还算幸运，整个过程比较顺利，因此现在系统又开始跑起来了。你可能会觉得迁移不是什么太麻烦的事情，不过对于<strong>一个几年没挪过窝，东西又烂又多，数据库打包都有8m，虚拟主机权限很少的人</strong>来说，这可是一档子大事情。</p>
<h3>mysql 4 to mysql 4.1</h3>
<p>首先面对的问题，是虚拟主机上的数据库又生了，4.0跳到4.1，老江湖都知道，mysql 4.1新增了字符集，一个没弄好就是页面乱码伺候。</p>
<p>另外一个问题，是前面提过的，原来的数据库用phpmyadmin打包出来，有8M，再用phpmyadmin导入是不用指望，在没有shell权限的情况下，要把这个数据导进去也挺麻烦。</p>
<p>最后用个意想不到的办法，就轻易解决了上面俩问题 —— 我们知道，<a href="http://www.ooso.net/index.php/archives/186">大容量的mysql数据的导入导出，还是命令行导出方便</a>，虽然说我没有虚拟主机的shell权限，但是php本身还是有办法调用shell的（感谢主机提供者，没有开启安全模式），按照这个思路，我首先将sql上传到服务器，然后用一行<a href="http://www.ooso.net/index.php/archives/category/php/">php</a>脚本就完成了数据的导入：</p>
<pre><code>&lt;?php `mysql -uroot -pxxxxxx dbname &lt; db.sql`?&gt;</code></pre>
<p>导入mysql之后的字符集是latin，和以前一致，程序不用做修改就可以投入使用了。</p>
<p>上一次迁移：<a href="http://www.ooso.net/index.php/archives/122">plog 2 wordpress</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.ooso.net/archives/224/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>mysql 5.1新功能 －－ 按日期分区</title>
		<link>http://www.ooso.net/archives/217</link>
		<comments>http://www.ooso.net/archives/217#comments</comments>
		<pubDate>Mon, 07 Aug 2006 23:42:42 +0000</pubDate>
		<dc:creator>Volcano</dc:creator>
				<category><![CDATA[mysql]]></category>

		<guid isPermaLink="false">http://www.ooso.net/index.php/archives/217</guid>
		<description><![CDATA[mysql 5.1已经到了beta版，官方网站上也陆续有一些文章介绍，比如上次看到的Improving Database Performance with Partitioning。在使用分区的前提下，可以用mysql实现非常大的数据量存储。今天在mysql的站上又看到一篇进阶的文章 —— 按日期分区存储。如果能够实现按日期分区，这对某些时效性很强的数据存储是相当实用的功能。下面是从这篇文章中摘录的一些内容。
错误的按日期分区例子
最直观的方法，就是直接用年月日这种日期格式来进行常规的分区：
mysql&#62;  create table rms (d date)

				<span class="readmore"><a href="http://www.ooso.net/archives/217" title="mysql 5.1新功能 －－ 按日期分区">阅读全文（3381字）</a></span>]]></description>
			<content:encoded><![CDATA[<p>mysql 5.1已经到了beta版，官方网站上也陆续有一些文章介绍，比如上次看到的<a href="http://www.ooso.net/index.php/archives/154">Improving Database Performance with Partitioning</a>。在使用分区的前提下，可以用mysql实现非常大的数据量存储。今天在mysql的站上又看到一篇进阶的文章 —— <a href="http://dev.mysql.com/tech-resources/articles/mysql_5.1_partitioning_with_dates.html">按日期分区存储</a>。如果能够实现按日期分区，这对某些时效性很强的数据存储是相当实用的功能。下面是从这篇文章中摘录的一些内容。</p>
<h3>错误的按日期分区例子</h3>
<p>最直观的方法，就是直接用年月日这种日期格式来进行常规的分区：</p>
<pre><code>mysql&gt;  create table rms (d date)
    -&gt;  partition by range (d)
    -&gt; (partition p0 values less than ('1995-01-01'),
    -&gt;  partition p1 VALUES LESS THAN ('2010-01-01'));</code></pre>
<p>上面的例子中，就是直接用&#8221;Y-m-d&#8221;的格式来对一个table进行分区，可惜想当然往往不能奏效，会得到一个错误信息:</p>
<blockquote><p>ERROR 1064 (42000): VALUES value must be of same type as partition function near &#8216;),<br />
 partition p1 VALUES LESS THAN (&#8217;2010-01-01&#8242;))&#8217; at line 3</p></blockquote>
<p>上述分区方式没有成功，而且明显的不经济，老练的DBA会用整型数值来进行分区：</p>
<pre><code>mysql&gt; CREATE TABLE part_date1
    -&gt;      (  c1 int default NULL,
    -&gt;  c2 varchar(30) default NULL,
    -&gt;  c3 date default NULL) engine=myisam
    -&gt;      partition by range (cast(date_format(c3,'%Y%m%d') as signed))
    -&gt; (PARTITION p0 VALUES LESS THAN (19950101),
    -&gt; PARTITION p1 VALUES LESS THAN (19960101) ,
    -&gt; PARTITION p2 VALUES LESS THAN (19970101) ,
    -&gt; PARTITION p3 VALUES LESS THAN (19980101) ,
    -&gt; PARTITION p4 VALUES LESS THAN (19990101) ,
    -&gt; PARTITION p5 VALUES LESS THAN (20000101) ,
    -&gt; PARTITION p6 VALUES LESS THAN (20010101) ,
    -&gt; PARTITION p7 VALUES LESS THAN (20020101) ,
    -&gt; PARTITION p8 VALUES LESS THAN (20030101) ,
    -&gt; PARTITION p9 VALUES LESS THAN (20040101) ,
    -&gt; PARTITION p10 VALUES LESS THAN (20100101),
    -&gt; PARTITION p11 VALUES LESS THAN MAXVALUE );
Query OK, 0 rows affected (0.01 sec)</code></pre>
<p>搞定？接着往下分析</p>
<p><span id="more-217"></span></p>
<pre><code>mysql&gt; explain partitions
    -&gt; select count(*) from part_date1 where
    -&gt;      c3 &gt; date '1995-01-01' and c3 &lt; date '1995-12-31'\G
*************************** 1. row ***************************
           id: 1
  select_type: SIMPLE
        table: part_date1
   partitions: p0,p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11
         type: ALL
possible_keys: NULL
          key: NULL
      key_len: NULL
          ref: NULL
         rows: 8100000
        Extra: Using where
1 row in set (0.00 sec)</code></pre>
<p>万恶的mysql居然对上面的sql使用全表扫描，而不是按照我们的日期分区分块查询。原文中解释到<a href="http://www.ooso.net/index.php/archives/category/mysql/">MYSQL</a>的优化器并不认这种日期形式的分区，花了大量的篇幅来引诱俺走上歧路，过分。</p>
<h3>正确的日期分区例子</h3>
<p>mysql优化器支持以下两种内置的日期函数进行分区：</p>
<ul>
<li>TO_DAYS() </li>
<li>YEAR()</li>
</ul>
<p>看个例子：</p>
<pre><code>mysql&gt; CREATE TABLE part_date3
    -&gt;      (  c1 int default NULL,
    -&gt;  c2 varchar(30) default NULL,
    -&gt;  c3 date default NULL) engine=myisam
    -&gt;      partition by range (to_days(c3))
    -&gt; (PARTITION p0 VALUES LESS THAN (to_days('1995-01-01')),
    -&gt; PARTITION p1 VALUES LESS THAN (to_days('1996-01-01')) ,
    -&gt; PARTITION p2 VALUES LESS THAN (to_days('1997-01-01')) ,
    -&gt; PARTITION p3 VALUES LESS THAN (to_days('1998-01-01')) ,
    -&gt; PARTITION p4 VALUES LESS THAN (to_days('1999-01-01')) ,
    -&gt; PARTITION p5 VALUES LESS THAN (to_days('2000-01-01')) ,
    -&gt; PARTITION p6 VALUES LESS THAN (to_days('2001-01-01')) ,
    -&gt; PARTITION p7 VALUES LESS THAN (to_days('2002-01-01')) ,
    -&gt; PARTITION p8 VALUES LESS THAN (to_days('2003-01-01')) ,
    -&gt; PARTITION p9 VALUES LESS THAN (to_days('2004-01-01')) ,
    -&gt; PARTITION p10 VALUES LESS THAN (to_days('2010-01-01')),
    -&gt; PARTITION p11 VALUES LESS THAN MAXVALUE );
Query OK, 0 rows affected (0.00 sec)</code></pre>
<p>以to_days()函数分区成功，我们分析一下看看：</p>
<pre><code>mysql&gt; explain partitions
    -&gt; select count(*) from part_date3 where
    -&gt;      c3 &gt; date '1995-01-01' and c3 &lt; date '1995-12-31'\G
*************************** 1. row ***************************
           id: 1
  select_type: SIMPLE
        table: part_date3
   partitions: p1
         type: ALL
possible_keys: NULL
          key: NULL
      key_len: NULL
          ref: NULL
         rows: 808431
        Extra: Using where
1 row in set (0.00 sec)</code></pre>
<p>可以看到，<a href="http://www.ooso.net/index.php/archives/category/mysql/">mysql</a>优化器这次不负众望，仅仅在p1分区进行查询。在这种情况下查询，真的能够带来提升查询效率么？下面分别对这次建立的part_date3和之前分区失败的part_date1做一个查询对比：</p>
<pre><code>mysql&gt; select count(*) from part_date3 where
    -&gt;      c3 &gt; date '1995-01-01' and c3 &lt; date '1995-12-31';
+----------+
| count(*) |
+----------+
|   805114 |
+----------+
1 row in set (4.11 sec)

mysql&gt; select count(*) from part_date1 where
    -&gt;      c3 &gt; date '1995-01-01' and c3 &lt; date '1995-12-31';
+----------+
| count(*) |
+----------+
|   805114 |
+----------+
1 row in set (40.33 sec)</code></pre>
<p>可以看到，分区正确的话query花费时间为4秒，而分区错误则花费时间40秒（相当于没有分区），效率有90％的提升！所以我们千万要正确的使用分区功能，分区后务必用explain验证，这样才能获得真正的性能提升。</p>
<p><strong>热切期待msyql 5.1稳定版发布!</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.ooso.net/archives/217/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>命令行下简单做到mysql的数据导入导出</title>
		<link>http://www.ooso.net/archives/186</link>
		<comments>http://www.ooso.net/archives/186#comments</comments>
		<pubDate>Wed, 07 Jun 2006 22:43:00 +0000</pubDate>
		<dc:creator>Volcano</dc:creator>
				<category><![CDATA[mysql]]></category>

		<guid isPermaLink="false">http://www.ooso.net/index.php/archives/186</guid>
		<description><![CDATA[在命令行下mysql的数据导出有个粉好用的工具mysqldump,,它的参数有一大把,可以这样查看:
mysqldump
我最常用的:
mysqldump -uroot databasefoo table1 table2 &#62; foo.sql

				<span class="readmore"><a href="http://www.ooso.net/archives/186" title="命令行下简单做到mysql的数据导入导出">阅读全文（288字）</a></span>]]></description>
			<content:encoded><![CDATA[<p>在命令行下mysql的数据导出有个粉好用的工具mysqldump,,它的参数有一大把,可以这样查看:</p>
<pre><code>mysqldump</code></pre>
<p>我最常用的:</p>
<pre><code>mysqldump -uroot databasefoo table1 table2 &gt; foo.sql</code></pre>
<p>这样就可以将数据库databasefoo的表table1,table2以sql形式导入foo.sql中,其中-uroot参数表示访问数据库的用户名是root,如果有密码还需要加上-p参数</p>
<p>mysql的数据导入也是相当便捷的,如:</p>
<pre><code>mysql -uroot databasefoo &lt; foo.sql</code></pre>
<p>这样就可以将foo.sql的数据全部导入数据库databasefoo</p>
<p></code></pre>
]]></content:encoded>
			<wfw:commentRss>http://www.ooso.net/archives/186/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>[mysql 5.1]使用Partitioning优化数据库性能</title>
		<link>http://www.ooso.net/archives/154</link>
		<comments>http://www.ooso.net/archives/154#comments</comments>
		<pubDate>Fri, 03 Mar 2006 09:05:27 +0000</pubDate>
		<dc:creator>Volcano</dc:creator>
				<category><![CDATA[mysql]]></category>
		<category><![CDATA[优化]]></category>

		<guid isPermaLink="false">http://www.ooso.net/index.php/archives/154</guid>
		<description><![CDATA[mysql 5.1新功能早知道 &#8212;- Partitioning
Improving Database Performance with Partitioning
mysql站上关于的Partitioning说明文档
]]></description>
			<content:encoded><![CDATA[<p>mysql 5.1新功能早知道 &#8212;- Partitioning<br />
<a href="http://dev.mysql.com/tech-resources/articles/performance-partitioning.html" target="_blank">Improving Database Performance with Partitioning</a></p>
<p><a href="http://www.mysql.com" target="_blank">mysql</a>站上<a href="http://dev.mysql.com/doc/refman/5.1/en/partitioning.html" target="_blank">关于的Partitioning说明文档</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.ooso.net/archives/154/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>mysql 5.1的计划任务 &#8211; Event</title>
		<link>http://www.ooso.net/archives/148</link>
		<comments>http://www.ooso.net/archives/148#comments</comments>
		<pubDate>Sat, 14 Jan 2006 04:10:43 +0000</pubDate>
		<dc:creator>Volcano</dc:creator>
				<category><![CDATA[mysql]]></category>

		<guid isPermaLink="false">http://www.ooso.net/index.php/archives/148</guid>
		<description><![CDATA[mysql的网站上多了一个关于5.1新特性Event(事件)的介绍 ,咋一看象是windows的计划任务,细一看,呵呵,正是如此.假如你有这样的需求&#8211;在今年年底之前,每天给我查查用户表里新增了哪些美女,说不定就可以用上Events特性了,下面是新建立Event的语法
[sql]CREATE EVENT
e                               /* 事件名 */
ON SCHEDULE

				<span class="readmore"><a href="http://www.ooso.net/archives/148" title="mysql 5.1的计划任务 &#8211; Event">阅读全文（482字）</a></span>]]></description>
			<content:encoded><![CDATA[<p>mysql的网站上多了一个关于5.1新特性Event(事件)的介绍 ,咋一看象是windows的计划任务,细一看,呵呵,正是如此.假如你有这样的需求&#8211;在今年年底之前,每天给我查查用户表里新增了哪些美女,说不定就可以用上Events特性了,下面是新建立Event的语法</p>
<p>[sql]CREATE EVENT<br />
e                               /* 事件名 */<br />
ON SCHEDULE<br />
EVERY 1 WEEK                    /* 执行间隔 */<br />
DO<br />
INSERT INTO t VALUES (0);       /* SQL statement */<br />
[/sql]</p>
<p>而要开启或关闭这个特性,只要执行下面的sql:<br />
[sql]SET GLOBAL event_scheduler = 1; /*0是关闭*/[/sql]</p>
<p>不管怎么说,<a href="http://www.mysql.com" target="_blank">mysql</a>的新版本是越来越强大了,但是在实际的项目中,还没有机会用上它们,很难说性能上是不是会打上折扣<br />
原文地址:<a href="http://dev.mysql.com/tech-resources/articles/event-feature.html" target="_blank">http://dev.mysql.com/tech-resources/articles/event-feature.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.ooso.net/archives/148/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>让phpBB 2.0.x 支持mysql 5.0</title>
		<link>http://www.ooso.net/archives/135</link>
		<comments>http://www.ooso.net/archives/135#comments</comments>
		<pubDate>Sat, 03 Dec 2005 03:40:40 +0000</pubDate>
		<dc:creator>Volcano</dc:creator>
				<category><![CDATA[mysql]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[phpbb]]></category>

		<guid isPermaLink="false">http://www.ooso.net/index.php/archives/135</guid>
		<description><![CDATA[目前的phpbb 2.0.x系列是不支持mysql 5.0的，但是可以通过小小的修改达到这个目的。
打开: 
install/schemas/mysql_schema.sql 
找到代码: 

				<span class="readmore"><a href="http://www.ooso.net/archives/135" title="让phpBB 2.0.x 支持mysql 5.0">阅读全文（240字）</a></span>]]></description>
			<content:encoded><![CDATA[<p>目前的<a href="http://www.phpbb.com">phpbb </a>2.0.x系列是不支持mysql 5.0的，但是可以通过小小的修改达到这个目的。</p>
<p>打开: </p>
<blockquote><p>install/schemas/mysql_schema.sql </p></blockquote>
<p>找到代码: </p>
<pre><code>bbcode_uid char(10) NOT NULL,</code></pre>
<p>替换成: </p>
<pre><code>bbcode_uid char(10) DEFAULT '' NOT NULL,</code></pre>
<p>然后安装的时候选择MySQL 4正常安装就可以使用mysql 5了<br />
原帖：<a href="http://www.phpbb.com/phpBB/viewtopic.php?f=14&#038;t=345312">http://www.phpbb.com/phpBB/viewtopic.php?f=14&#038;t=345312</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.ooso.net/archives/135/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>mysql 5.0的新特性 &#8212; 存储过程</title>
		<link>http://www.ooso.net/archives/118</link>
		<comments>http://www.ooso.net/archives/118#comments</comments>
		<pubDate>Wed, 30 Nov -0001 00:00:00 +0000</pubDate>
		<dc:creator>Volcano</dc:creator>
				<category><![CDATA[mysql]]></category>

		<guid isPermaLink="false">/?p=118</guid>
		<description><![CDATA[在mysql的官方网站看到关于mysql 5.0介绍文章 &#8212; MySQL 5.0 New Features: Stored Procedures
那么mysql 5.0有哪些新特性呢?很简单 &#8212; &#8220;stored procedures, triggers, views, information_schema&#8221;,详细内容
]]></description>
			<content:encoded><![CDATA[<p>在<a href="http://www.mysql.com/">mysql</a>的官方网站看到关于mysql 5.0介绍文章 &#8212; <font size="3">MySQL 5.0 New Features: Stored Procedures</font></p>
<p>那么mysql 5.0有哪些新特性呢?很简单 &#8212; &#8220;stored procedures, triggers, views, information_schema&#8221;,<a href="http://dev.mysql.com/tech-resources/articles/mysql-storedprocedures.html">详细内容</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.ooso.net/archives/118/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

