<?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>Herbert Yang &#187; MySQL</title>
	<atom:link href="http://www.herbertyang.com/tag/mysql/feed" rel="self" type="application/rss+xml" />
	<link>http://www.herbertyang.com</link>
	<description></description>
	<lastBuildDate>Wed, 13 Jul 2011 07:02:51 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.5</generator>
		<item>
		<title>把wordpress搬到nginx环境</title>
		<link>http://www.herbertyang.com/2010/09/09/moved-to-wordpress-nginx-environment.html</link>
		<comments>http://www.herbertyang.com/2010/09/09/moved-to-wordpress-nginx-environment.html#comments</comments>
		<pubDate>Thu, 09 Sep 2010 14:38:11 +0000</pubDate>
		<dc:creator>Herbert</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[Memcached]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Nginx]]></category>

		<guid isPermaLink="false">http://www.herbertyang.com/?p=634</guid>
		<description><![CDATA[这次并不是换了博客的宿主，而是更换了博客的主机（VPS）。换到国外的服务器去了，虽然响应时间慢了点，但整体的速度要比以前的虚拟主机要快。 这次搬家的过程中，碰到了些容易出现的问题。 比如MySQL数据库的编码问题，这个配置MySQL的时候，要注意增加配置 [client] default-character-set = utf8 [mysqld] default-character-set = utf8 下面的这些语句可能对你有用： alter database blog character set utf8; create database mydb character set utf-8; SHOW VARIABLES LIKE 'character_set_%'; SHOW VARIABLES LIKE 'collation_%'; 当然在配置Nginx上也要注意一个地方，这样就支持了wordpress的伪静态 log_format main '$remote_addr - $remote_user [$time_local] &#34;$request&#34; ' '$status $body_bytes_sent &#34;$http_referer&#34; ' '&#34;$http_user_agent&#34; &#34;$http_x_forwarded_for&#34;'; server { listen 80; server_name www.herbertyang.com; access_log logs/blog.access.log]]></description>
			<content:encoded><![CDATA[<p>这次并不是换了博客的宿主，而是更换了博客的主机（VPS）。换到国外的服务器去了，虽然响应时间慢了点，但整体的速度要比以前的虚拟主机要快。</p>
<p>这次搬家的过程中，碰到了些容易出现的问题。</p>
<p>比如MySQL数据库的编码问题，这个配置MySQL的时候，要注意增加配置</p>
<pre class="brush: bash; title: ;">

[client]
 default-character-set = utf8

[mysqld]
 default-character-set = utf8
</pre>
<p>下面的这些语句可能对你有用：</p>
<pre class="brush: sql; title: ;">
alter database blog character set utf8;
create database mydb character set utf-8;

SHOW VARIABLES LIKE 'character_set_%';
SHOW VARIABLES LIKE 'collation_%';
</pre>
<p>当然在配置Nginx上也要注意一个地方，这样就支持了wordpress的伪静态</p>
<pre class="brush: bash; title: ;">
    log_format  main  '$remote_addr - $remote_user [$time_local] &quot;$request&quot; '
                      '$status $body_bytes_sent &quot;$http_referer&quot; '
                      '&quot;$http_user_agent&quot; &quot;$http_x_forwarded_for&quot;';
    server {
        listen       80;
        server_name  www.herbertyang.com;
        access_log  logs/blog.access.log  main;
        location / {
	    add_header Content-Type &quot;text/html; charset=UTF-8&quot;;
            add_header Content-Encoding &quot;gzip&quot;;
	    try_files $uri $uri/ /index.php?q=$uri&amp;$args;
            root   /home/app/phproot/wordpress;
            index  index.php index.html index.htm;
        }
	location ~* \.(jpg|jpeg|png|gif|css|js|swf|mp3|avi|flv|xml|zip|rar)$ {
		expires 30d;
        	gzip on;
       		gzip_types  text/plain application/x-javascript text/css application/xml;
		root   /home/app/phproot/wordpress;
	}
        location ~ \.php$ {
            root           html;
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_index  index.php;
            fastcgi_param  SCRIPT_FILENAME  /home/app/phproot/wordpress$fastcgi_script_name;
            include        fastcgi_params;
        }
        location ~ /\.ht {
           deny  all;
        }
    }
</pre>
<p>最后也把Wordpress加上了Memcached，速度还是快了一点，响应的速度有点慢，不过感觉流畅很多。</p>
<p>参考网址：<br />
<a href="http://blog.s135.com/nginx_php_v6/" target="_blank">http://blog.s135.com/nginx_php_v6/</a><br />
<a href="http://www.23day.com/html/22890.html" target="_blank">http://www.23day.com/html/22890.html</a><br />
<a href="http://www.nonabyte.net/nginx-wordpress-rewrite/" target="_blank">http://www.nonabyte.net/nginx-wordpress-rewrite/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.herbertyang.com/2010/09/09/moved-to-wordpress-nginx-environment.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>批量删除某个前缀的表[MySQL]</title>
		<link>http://www.herbertyang.com/2009/04/09/%e6%89%b9%e9%87%8f%e5%88%a0%e9%99%a4%e6%9f%90%e4%b8%aa%e5%89%8d%e7%bc%80%e7%9a%84%e8%a1%a8mysql.html</link>
		<comments>http://www.herbertyang.com/2009/04/09/%e6%89%b9%e9%87%8f%e5%88%a0%e9%99%a4%e6%9f%90%e4%b8%aa%e5%89%8d%e7%bc%80%e7%9a%84%e8%a1%a8mysql.html#comments</comments>
		<pubDate>Thu, 09 Apr 2009 03:15:52 +0000</pubDate>
		<dc:creator>Herbert</dc:creator>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://blog.shishuo.com/?p=162</guid>
		<description><![CDATA[由于本站点尝试过安装了BBS和其它一个博客，但又被我卸载了，现在想把这些有特殊前缀的表全部删掉。好像MySQL本身没有这个功能，所以找方法取而代之。 先运行下面的SQL语句： select concat('drop table ', table_name, ';') from information_schema.tables where table_name like 'bbs_%'; 然后得到一个drop table bbs_* 的列表，很简单了，到控制台跑一遍就可以了。]]></description>
			<content:encoded><![CDATA[<p>由于本站点尝试过安装了BBS和其它一个博客，但又被我卸载了，现在想把这些有特殊前缀的表全部删掉。好像MySQL本身没有这个功能，所以找方法取而代之。</p>
<p>先运行下面的SQL语句：</p>
<pre class="brush: sql; title: ;">

select concat('drop table ', table_name, ';') from information_schema.tables where table_name like 'bbs_%';
</pre>
<p>然后得到一个drop table bbs_* 的列表，很简单了，到控制台跑一遍就可以了。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.herbertyang.com/2009/04/09/%e6%89%b9%e9%87%8f%e5%88%a0%e9%99%a4%e6%9f%90%e4%b8%aa%e5%89%8d%e7%bc%80%e7%9a%84%e8%a1%a8mysql.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

