<?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>JohnPuPu &#187; MySQL</title>
	<atom:link href="http://blog.johnpupu.tw/category/mysql/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.johnpupu.tw</link>
	<description>博觀而約取，厚積而薄發</description>
	<lastBuildDate>Sat, 28 Jan 2012 15:43:59 +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>Setting up a redundant MySQL with HAST and CARP</title>
		<link>http://blog.johnpupu.tw/2011/03/10/setting-up-a-redundant-mysql-with-hast-and-carp/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=setting-up-a-redundant-mysql-with-hast-and-carp</link>
		<comments>http://blog.johnpupu.tw/2011/03/10/setting-up-a-redundant-mysql-with-hast-and-carp/#comments</comments>
		<pubDate>Thu, 10 Mar 2011 00:00:44 +0000</pubDate>
		<dc:creator>johnpupu</dc:creator>
				<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[CARP]]></category>
		<category><![CDATA[HAST]]></category>

		<guid isPermaLink="false">http://blog.johnpupu.tw/?p=585</guid>
		<description><![CDATA[Common Address Redundancy Protocol ( CARP ) 角色說明 主要會有兩種角色, 一種是Host(  Primary ), 一種是Provider ( Secondary ) Host 主要就是我們提供服務的機器 Provider 就是當Host 掛掉後, 接手服務的機器 參數說明 ( 這部份看原文吧, 這是我看OpenBSD上找來的, FreeBSD上敘述的比較少, 請大家搭配著一起服用 ) vhid The Virtual Host ID. This is a unique number that is used to identify the redundancy group to other nodes on the network. Acceptable values [...]]]></description>
		<wfw:commentRss>http://blog.johnpupu.tw/2011/03/10/setting-up-a-redundant-mysql-with-hast-and-carp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Zend Framework DB Load Balancing (Master/Slave Database)</title>
		<link>http://blog.johnpupu.tw/2008/08/28/zend-framework-db-load-balancing-masterslave-database/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=zend-framework-db-load-balancing-masterslave-database</link>
		<comments>http://blog.johnpupu.tw/2008/08/28/zend-framework-db-load-balancing-masterslave-database/#comments</comments>
		<pubDate>Thu, 28 Aug 2008 05:47:41 +0000</pubDate>
		<dc:creator>johnpupu</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[program]]></category>
		<category><![CDATA[mysql Zend_Framework php]]></category>

		<guid isPermaLink="false">http://blog.johnpupu.tw/?p=256</guid>
		<description><![CDATA[網路上找來找去&#8230;&#8230; 沒看到有人寫相關的解法&#8230;. 加上不想用mysql-proxy來解這部份&#8230; 所以打算從code 的部份下手 看到最後只能動Zend Framework 的code 了(還沒想到可以不動ZF 的code 而做到DB LB的方法) 我是先從function save 下手去找.. Zend/Table/Row/Abstract.php:    public function save() [sourcecode language='php'] public function save() { /** * If the _cleanData array is empty, * this is an INSERT of a new row. * Otherwise it is an UPDATE. */ if (empty($this->_cleanData)) { return $this->_doInsert(); } [...]]]></description>
		<wfw:commentRss>http://blog.johnpupu.tw/2008/08/28/zend-framework-db-load-balancing-masterslave-database/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Performance Tuning Best Practices for MySQL</title>
		<link>http://blog.johnpupu.tw/2008/07/30/performance-tuning-best-practices-for-mysql/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=performance-tuning-best-practices-for-mysql</link>
		<comments>http://blog.johnpupu.tw/2008/07/30/performance-tuning-best-practices-for-mysql/#comments</comments>
		<pubDate>Wed, 30 Jul 2008 05:39:51 +0000</pubDate>
		<dc:creator>johnpupu</dc:creator>
				<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://blog.johnpupu.tw/?p=220</guid>
		<description><![CDATA[這是Jay Pipes 在Google 演講時有關MySQL Tuning 的Tips Direct URL: http://video.google.com/videoplay?docid=2524524540025172110 [02:20] Don’t benchmark without a goal. Have a goal like “improve performance by 20%”. Otherwise you’ll waste a lot of time tuning milliseconds out of your application. [02:50] Change just one thing at a time and re-run the benchmarks. [03:40] Disable the query cache by setting [...]]]></description>
		<wfw:commentRss>http://blog.johnpupu.tw/2008/07/30/performance-tuning-best-practices-for-mysql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tuning MySQL ..</title>
		<link>http://blog.johnpupu.tw/2008/04/21/tuning-mysql/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=tuning-mysql</link>
		<comments>http://blog.johnpupu.tw/2008/04/21/tuning-mysql/#comments</comments>
		<pubDate>Mon, 21 Apr 2008 05:03:13 +0000</pubDate>
		<dc:creator>johnpupu</dc:creator>
				<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[mysql freebsd]]></category>

		<guid isPermaLink="false">http://blog.johnpupu.tw/?p=202</guid>
		<description><![CDATA[因為被slow query 搞的很煩&#8230;.網站速度一直起不來 因為Database 設計上的問題&#8230;..(幾個比較常用的Table 大蓋都差不多有70萬個Record ) 且因為我Table Engine 是 MyISAM 用Rep 的話&#8230;.若是crash 要修&#8230;好像很麻煩&#8230; 所以變成要用Rep 的話最好能先轉成InnoDB 不過因為我Slow Query 很多&#8230;若是我Rep Master Lock 的話 Slave 也會卡住&#8230;.. 也不是完全的解決了Slow Query這問題&#8230;. 所以我想最完美的解法可能是 Rep + Aging&#8230; 不過要花不少時間來整個改&#8230;&#8230; 當前沒這麼多時間讓我來用這些&#8230; 所以我目前的解法是&#8230; 加Ram 然後把MySQL 的Ram 讓他吃愈多愈好&#8230; Ref MYSQL優化詳細介紹！ 7.5.2. Tuning Server Parameters Section 5.1.3, “System Variables” 5.1.2. Command Options Section 5.1.5, “Status Variables”. 5.2.4. [...]]]></description>
		<wfw:commentRss>http://blog.johnpupu.tw/2008/04/21/tuning-mysql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>super-smack(MySQL Benchmark tool)</title>
		<link>http://blog.johnpupu.tw/2008/03/19/super-smackmysql-benchmark-tool/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=super-smackmysql-benchmark-tool</link>
		<comments>http://blog.johnpupu.tw/2008/03/19/super-smackmysql-benchmark-tool/#comments</comments>
		<pubDate>Wed, 19 Mar 2008 05:44:41 +0000</pubDate>
		<dc:creator>johnpupu</dc:creator>
				<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[mysql freebsd]]></category>

		<guid isPermaLink="false">http://blog.johnpupu.tw/?p=198</guid>
		<description><![CDATA[剛剛在Joehorn 的個人版上看到的&#8230;. 我整個很lag&#8230; ports 裡面已經有了&#8230;&#8230; 裝好後.. cp /usr/local/share/super-smack/* ~ 才會有 select-key.smack和update-select.smack 這兩個檔案&#8230;. 執行的話..就在console 下 #super-smack -d mysql select-key.smack 80 100 我的blog 機是FreeBSD 7.0 R CPU: Intel(R) Xeon(TM) CPU 2.60GHz (2591.61-MHz 686-class CPU), RAM:2G HD: 10K SCSI 36.4G FS: UFS2 數據是 Query_type num_queries max_time min_time q_per_s select_index 8000 102 0 1164.87 update_index 8000 73 0 1164.87 [...]]]></description>
		<wfw:commentRss>http://blog.johnpupu.tw/2008/03/19/super-smackmysql-benchmark-tool/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL Active Report</title>
		<link>http://blog.johnpupu.tw/2007/11/23/mysql-active-report/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=mysql-active-report</link>
		<comments>http://blog.johnpupu.tw/2007/11/23/mysql-active-report/#comments</comments>
		<pubDate>Fri, 23 Nov 2007 04:58:30 +0000</pubDate>
		<dc:creator>johnpupu</dc:creator>
				<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://blog.johnpupu.tw/?p=180</guid>
		<description><![CDATA[一如往常..在看訂閱的rss 的時後.. 其中這篇 有介紹幾個mysql 的工具.. 其中mytop 已經快樂使用中&#8230; 另一個就是 MySQL Active Report 看起來挺不錯的.. 一樣在ports 裡面也有.. #cd /usr/ports/databases/mysqlard/ #make install clean 裝好後的提示似乎不是很完整 1) Add the &#8216;mysqlar&#8217; user with USAGE privileges to your mysql server: $ mysql -u root -p mysql mysql&#62; GRANT USAGE ON *.* TO mysqlar@localhost; mysql&#62; FLUSH PRIVILEGES; 2) Add the mysqlard crontab to root&#8217;s [...]]]></description>
		<wfw:commentRss>http://blog.johnpupu.tw/2007/11/23/mysql-active-report/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>找出Table 中 資料相同的Record</title>
		<link>http://blog.johnpupu.tw/2007/09/12/%e6%89%be%e5%87%batable-%e4%b8%ad-%e8%b3%87%e6%96%99%e7%9b%b8%e5%90%8c%e7%9a%84record/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=%25e6%2589%25be%25e5%2587%25batable-%25e4%25b8%25ad-%25e8%25b3%2587%25e6%2596%2599%25e7%259b%25b8%25e5%2590%258c%25e7%259a%2584record</link>
		<comments>http://blog.johnpupu.tw/2007/09/12/%e6%89%be%e5%87%batable-%e4%b8%ad-%e8%b3%87%e6%96%99%e7%9b%b8%e5%90%8c%e7%9a%84record/#comments</comments>
		<pubDate>Wed, 12 Sep 2007 18:48:37 +0000</pubDate>
		<dc:creator>johnpupu</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[program]]></category>
		<category><![CDATA[sql]]></category>
		<category><![CDATA[程式]]></category>

		<guid isPermaLink="false">http://blog.johnpupu.tw/?p=169</guid>
		<description><![CDATA[因為有遇到這個問題 所以特別寫出來備忘 SELECT * FROM bb_downloads a WHERE (SELECT count( * ) FROM bb_downloads b WHERE b.post_id = a.post_id AND b.url = a.url ) &#62;1 ORDER BY `post_id`,`download_times` DESC reference UPDATE: 2007/10/14 找出不相同的資料 非常的easy select r.user_id from rtable r WHERE r.user_id not in (select a.user_id from atable a) 刪除不相同的資料 delete from rtable WHERE user_id not [...]]]></description>
		<wfw:commentRss>http://blog.johnpupu.tw/2007/09/12/%e6%89%be%e5%87%batable-%e4%b8%ad-%e8%b3%87%e6%96%99%e7%9b%b8%e5%90%8c%e7%9a%84record/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL 4.1.x 編碼問題(UTF8)</title>
		<link>http://blog.johnpupu.tw/2007/03/31/mysql-41x-%e7%b7%a8%e7%a2%bc%e5%95%8f%e9%a1%8cutf8/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=mysql-41x-%25e7%25b7%25a8%25e7%25a2%25bc%25e5%2595%258f%25e9%25a1%258cutf8</link>
		<comments>http://blog.johnpupu.tw/2007/03/31/mysql-41x-%e7%b7%a8%e7%a2%bc%e5%95%8f%e9%a1%8cutf8/#comments</comments>
		<pubDate>Sat, 31 Mar 2007 16:16:11 +0000</pubDate>
		<dc:creator>johnpupu</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[mysql-encoding]]></category>

		<guid isPermaLink="false">http://blog.johnpupu.tw/?p=137</guid>
		<description><![CDATA[剛剛寫code發現在phpMyAdmin裡面的中文看起來非常正常 不過程式print 卻都是亂碼，很怪!! 後來google 了一下，發現是 有 SUPER 權限的 user 在連線的時候不會去執行 init_connect 所以說即使我的 init_connect=&#8217;SET NAMES utf8&#8242; 還是沒用 因為我db是用root連的&#8230;&#8230;&#8230;. 所以才會是亂碼~~ :*-): 直接去開了一個新帳號來用就好了。 ref. MySQL 4.1.x SET NAMES UTF8]]></description>
		<wfw:commentRss>http://blog.johnpupu.tw/2007/03/31/mysql-41x-%e7%b7%a8%e7%a2%bc%e5%95%8f%e9%a1%8cutf8/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL backup and restore</title>
		<link>http://blog.johnpupu.tw/2007/03/24/mysql-backup-and-restore/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=mysql-backup-and-restore</link>
		<comments>http://blog.johnpupu.tw/2007/03/24/mysql-backup-and-restore/#comments</comments>
		<pubDate>Sat, 24 Mar 2007 09:53:21 +0000</pubDate>
		<dc:creator>johnpupu</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[mysql-backup]]></category>

		<guid isPermaLink="false">http://blog.johnpupu.tw/?p=129</guid>
		<description><![CDATA[因為翰x要移機，所以要把db 上的資料轉出來，不過因為用mysql db &#60; db.sql 常常會出他媽的鬼問題，很杜爛!!! 所以單純把資料dump 成 text file 會是一個比較好的方式，然後再透過mysqlimport 或是LOAD DATA INFILE。 我寫了兩個小小的scripts 就是dump和 restore 有須要的人請自行服用 ::-p: 1.import_db.sh db_dir=$1 db=$2 for file in `find $1 -type f -depth 1 &#124; egrep txt` do table=`echo $file &#124;cut -d &#8220;/&#8221; -f 5&#124;cut -d &#8220;.&#8221; -f 1` echo &#8216;import data to &#8216;$table&#8217; finished &#8216; /usr/local/bin/mysql -u [...]]]></description>
		<wfw:commentRss>http://blog.johnpupu.tw/2007/03/24/mysql-backup-and-restore/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL replication</title>
		<link>http://blog.johnpupu.tw/2007/01/14/mysql-replication/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=mysql-replication</link>
		<comments>http://blog.johnpupu.tw/2007/01/14/mysql-replication/#comments</comments>
		<pubDate>Sun, 14 Jan 2007 14:56:40 +0000</pubDate>
		<dc:creator>johnpupu</dc:creator>
				<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://blog.johnpupu.tw/?p=110</guid>
		<description><![CDATA[昨天和貓哥談到了關於備份移機的事， 有談到關於mysql replication so 找了一下有關於 mysql replication 的資料 簡單來說mysql replication 就是主要架設一台Mysql Master 和一些slave。 而slave 會主動和master 要資料， 且可以提供query ，來分散一些master 的load 當master 有更新時，slave 就會和master 要資料更新。 so 也就達到備份的效果 而mysql replication 有不少作法 如one-way, multi-way , circle One Way replicaton 例如A跟B B不write, 只有A write, 然後A是master 這叫做one-way Multi Way replication 如果A, B都能write, 互相以對方為master 就是multi-way Circle 而Circle 又分 circle, double circle, semi-double [...]]]></description>
		<wfw:commentRss>http://blog.johnpupu.tw/2007/01/14/mysql-replication/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

