﻿<?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/SQL/数据库优化</title>
	<atom:link href="http://www.ieliwb.com/category/sql/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ieliwb.com</link>
	<description>灵感的来临，没有任何预兆；灵感的消失，也不会有告别仪式；用文字记下她们吧，让灵感永存……</description>
	<lastBuildDate>Sun, 21 Nov 2010 03:36:35 +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>Linux下mysql定时自动备份并FTP到远程脚本</title>
		<link>http://www.ieliwb.com/linux-mysql-auto-backup/</link>
		<comments>http://www.ieliwb.com/linux-mysql-auto-backup/#comments</comments>
		<pubDate>Fri, 18 Dec 2009 03:28:24 +0000</pubDate>
		<dc:creator>花太香齐</dc:creator>
				<category><![CDATA[Linux/Shell/Server]]></category>
		<category><![CDATA[Mysql/SQL/数据库优化]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[自动备份]]></category>

		<guid isPermaLink="false">http://www.ieliwb.com/linux%e4%b8%8bmysql%e5%ae%9a%e6%97%b6%e8%87%aa%e5%8a%a8%e5%a4%87%e4%bb%bd%e5%b9%b6ftp%e5%88%b0%e8%bf%9c%e7%a8%8b%e8%84%9a%e6%9c%ac/</guid>
		<description><![CDATA[<p><strong>1.添加backupmysqleveryday.sh（vi /data/shell/backupmysqleveryday.sh）</strong></p>
<div class="hl-surround"><ol class="hl-main ln-show" title="Double click to hide line number." ondblclick = "linenumber(this)"><li class="hl-firstline">#!/bin/sh</li>
<li>#this shell is user for backup mysql data everyday</li>
<li>#author:www.ieliwb.com [......]</li></ol></div><p class='read-more'><a href='http://www.ieliwb.com/linux-mysql-auto-backup/'>继续阅读</a></p>]]></description>
			<content:encoded><![CDATA[<p><strong>1.添加backupmysqleveryday.sh（vi /data/shell/backupmysqleveryday.sh）</strong></p>
<div class="hl-surround"><ol class="hl-main ln-show" title="Double click to hide line number." ondblclick = "linenumber(this)"><li class="hl-firstline">#!/bin/sh</li>
<li>#this shell is user for backup mysql data everyday</li>
<li>#author:www.ieliwb.com </li>
<li>&nbsp;</li>
<li>#path-config</li>
<li>base_mysql_path=/data/webserver/mysql/</li>
<li>mysql_dump_path=/data/mysqlbackup/</li>
<li>mnt_back_path=/mnt/web/mysqlbackup/ </li>
<li>ftp_back_path=mysql_data_backup/</li>
<li>&nbsp;</li>
<li>#mysql-config</li>
<li>mysql_user=&quot;root&quot;</li>
<li>mysql_pass=&quot;*******&quot;</li>
<li>&nbsp;</li>
<li>#ftp-config</li>
<li>ftp_host=&quot;ip&quot;</li>
<li>ftp_user=&quot;********&quot;</li>
<li>ftp_pass=&quot;********&quot;</li>
<li>&nbsp;</li>
<li>backup_name=`date +%Y%m%d%H%M%S`</li>
<li>&nbsp;</li>
<li>cd ${mysql_dump_path}</li>
<li>&nbsp;</li>
<li>#mysqldump</li>
<li>${base_mysql_path}bin/mysqldump -u${mysql_user} -p${mysql_pass} --all-database &gt; ${backup_name}.sql</li>
<li>&nbsp;</li>
<li>#pack</li>
<li>tar zcf ${backup_name}.tar.gz ${backup_name}.sql</li>
<li>rm -f ${backup_name}.sql</li>
<li>&nbsp;</li>
<li>#backup to mnt</li>
<li>cp ${backup_name}.tar.gz ${mnt_back_path}${backup_name}.tar.gz</li>
<li>&nbsp;</li>
<li>#ftp to other host</li>
<li>ftp -n&lt;&lt;!</li>
<li>open ${ftp_host}</li>
<li>user ${ftp_user} ${ftp_pass}</li>
<li>bin</li>
<li>prompt off</li>
<li>cd ${ftp_back_path}</li>
<li>passive</li>
<li>put ${backup_name}.tar.gz</li>
<li>close</li>
<li>bye</li>
<li>!</li></ol></div>
<p><strong>2.添加定时计划（vi /etc/crontab）</strong></p>
<blockquote><p>
01 0 * * * root /data/shell/backupmysqleveryday.sh<br />
每天0：01点执行
</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.ieliwb.com/linux-mysql-auto-backup/feed/</wfw:commentRss>
		<slash:comments>1147</slash:comments>
		</item>
		<item>
		<title>wordpress慢的几个可能原因分析</title>
		<link>http://www.ieliwb.com/wordpress-slow/</link>
		<comments>http://www.ieliwb.com/wordpress-slow/#comments</comments>
		<pubDate>Mon, 14 Dec 2009 09:17:08 +0000</pubDate>
		<dc:creator>花太香齐</dc:creator>
				<category><![CDATA[CMS/BBS开源原创作品]]></category>
		<category><![CDATA[Mysql/SQL/数据库优化]]></category>
		<category><![CDATA[PHP/WEB]]></category>
		<category><![CDATA[Windows/Cmd]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://localhost/wordpress/?p=175</guid>
		<description><![CDATA[<p><strong>1.wordpress在windows平台下运行缓慢的原因</strong></p>
<blockquote><p>
网络解答：<br />
在本地装了一个wordpress平台，中文版的，速度很慢，一直都没有搞清楚原因。最开始以为是连接数据库的速度慢造成的，不过直接连mysql的速度还是很快的。今天干脆下了点功夫，逐步跟踪，发现速度原来是在载入中文语言包的时候变慢[......]</p></blockquote><p class='read-more'><a href='http://www.ieliwb.com/wordpress-slow/'>继续阅读</a></p>]]></description>
			<content:encoded><![CDATA[<p><strong>1.wordpress在windows平台下运行缓慢的原因</strong></p>
<blockquote><p>
网络解答：<br />
在本地装了一个wordpress平台，中文版的，速度很慢，一直都没有搞清楚原因。最开始以为是连接数据库的速度慢造成的，不过直接连mysql的速度还是很快的。今天干脆下了点功夫，逐步跟踪，发现速度原来是在载入中文语言包的时候变慢的。将wp-settings.php中的 load_default_textdomain()这一行注释掉，速度就上来了。<br />
wordpress的语言包是后缀为mo的二进制文件，在windows平台下对这种文件的解析和读取异常缓慢，而在linux平台下却基本感觉不出来。所以，如果要在windows平台下使用wordpress的话，要么直接用英文版，要么直接将中文内嵌到程序中去替代英文。
</p></blockquote>
<p>测试：去掉语言包功能在win下速度提升了一半以上，我晕。</p>
<p><strong>2.边栏按月归档 ARCHIVE的分月列表取消吧，日历取消吧</strong></p>
<p>mysql慢查询分析测试：<br />
修改my.cnf或者在mysql启动的时候加入一些参数。如果在my.cnf里面修改，需增加如下几行<br />
<code><br />
long_query_time = 1<br />
log-slow-queries = "D:\My HTTP Server\MySQL Server\slow.log"<br />
log-queries-not-using-indexes<br />
</code></p>
<blockquote><p>long_query_time 是指执行超过多久的sql会被log下来，这里是1秒。<br />
log-slow-queries 设置把日志写在那里，可以为空，系统会给一个缺省的文件host_name-slow.log，<br />
log-queries-not-using-indexes 就是字面意思，log下来没有使用索引的query。</p></blockquote>
<p>可以看到按月归档查询是个很大的罪魁祸首。</p>
<p><strong>3.下载一个叫pear的加速吧,很小.速度确实提升不少.到插件中搜索pear即可. </strong></p>
<p><strong>4. 整个PHP SPEEDY吧，速度提升了不少。</strong><br />
PHP Speedy扫描博客加载的js, css，并将它们合并压缩，减少HTTP请求数量，以加快博客的加载速度。http://aciddrop.com/php-speedy/</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ieliwb.com/wordpress-slow/feed/</wfw:commentRss>
		<slash:comments>1268</slash:comments>
		</item>
	</channel>
</rss>

