<?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://blog.goods-pro.com/tag/mysql/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.goods-pro.com</link>
	<description>草的家园，花在哪里？</description>
	<lastBuildDate>Wed, 08 Sep 2010 23:24:07 +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>xls is the best data import format for phpmyadmin</title>
		<link>http://blog.goods-pro.com/1853/xls-is-the-best-data-import-format-for-phpmyadmin/</link>
		<comments>http://blog.goods-pro.com/1853/xls-is-the-best-data-import-format-for-phpmyadmin/#comments</comments>
		<pubDate>Wed, 08 Sep 2010 22:55:05 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[小小草]]></category>
		<category><![CDATA[microsoft]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[openoffice]]></category>

		<guid isPermaLink="false">http://blog.goods-pro.com/?p=1853</guid>
		<description><![CDATA[尽管我挺不愿意看到这个结果，但事实是 xls (Excel 97-2003 XLS Workbook) 是在 phpmyadmin 中导入大量数据的最佳选择。xls 优于 csv 和 ods (Open Document Spreadsheet) 格式，尤其是在行数据差异比较大时（比如有 empty cell）。
尽管我用 Open Office Calc 生成原始数据，但保存为 Open Office 嫡出的 ods 格式再导入时，数据变得参差不齐。我正绝望时，试着保存为 xls 格式再导入，一切 OK。
回想 microsoft 所出的各种应用程序，确实有它强大的地方，至少有一点无人能及——在各应用程序间流畅地拷贝、粘贴。
]]></description>
		<wfw:commentRss>http://blog.goods-pro.com/1853/xls-is-the-best-data-import-format-for-phpmyadmin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>phpMyAdmin 2002 error</title>
		<link>http://blog.goods-pro.com/1841/phpmyadmin-2002-error/</link>
		<comments>http://blog.goods-pro.com/1841/phpmyadmin-2002-error/#comments</comments>
		<pubDate>Sun, 05 Sep 2010 01:01:15 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[小小草]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://blog.goods-pro.com/?p=1841</guid>
		<description><![CDATA[最近把家里的测试服务器 Zend Server php 5.2 卸载了，重新安装了 5.3。phpMyAdmin 随着 5.2 卸载也被卸载了。我用
yum install phpMyAdmin
重新安装了 phpMyAdmin。在 config.inc.php 设置了必要的参数，但 phpMyAdmin prompted:
#2002 &#8211; The server is not responding (or the local MySQL server&#8217;s socket is not correctly configured)
我浪费了很多时间检查了所有可能的错误，却解决不了问题。最后在 phpmyadmin.net 下载了源码，使用同样的 config.inc.php，顺利登录！
]]></description>
		<wfw:commentRss>http://blog.goods-pro.com/1841/phpmyadmin-2002-error/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A tool to synchronise Magento database between servers</title>
		<link>http://blog.goods-pro.com/1657/a-tool-to-synchronise-magento-database-between-servers/</link>
		<comments>http://blog.goods-pro.com/1657/a-tool-to-synchronise-magento-database-between-servers/#comments</comments>
		<pubDate>Mon, 28 Jun 2010 21:01:14 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[小小草]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[magento]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://blog.goods-pro.com/?p=1657</guid>
		<description><![CDATA[我时不时需要在测试服务器上加载生产服务器的实时数据，以前都是把数据下载到本地的测试服务器后，手工键入一些命令完成数据加载，每次都要花费几分钟时间。为了避免一再“浪费”这几分钟，我今天一次性投入了几小时完成了一个 php 脚本。虽然这是为 magento 的数据迁移而写的脚本，但我写完一看，用在其他地方也是可以的。
为了安全起见，该脚本是用 php 命令行运行的，所有输出针对 terminal 美化，不是 browser。保存源码为 data_mover.php，同一目录下要有 mysqldump 得到的经 gzip 的 sql 文件，文件名以 FILENAME_PREFIX 开头，以 .sql.gz 结尾。启动时只需键入
/path/to/php -f data_mover.php
即可。
初始化 PDO 对象时，按理只需要 host=localhost，不需要 unix_socket=MYSQL_SOCKET。但奇怪的是，如果通过 apache 调用本程序（虽然不是本程序的初衷，但我希望它在浏览器下也能运行），仅指定 host=localhost 作 PDO __construct() 参数，会产生一个莫名其妙的错误：
SQLSTATE[HY000] [2002] Can&#8217;t connect to local MySQL server through socket &#8216;/tmp/mysql.sock&#8217; (2) 
似乎是 PDO bug。可以通过 host=127.0.0.1 或者追加 unix_socket=MYSQL_SOCKET 来避免。如果通过 php 命令行启动则没有这个问题。
而后，还涉及怎么删除所有数据表的问题。看似简单的一个问题，我发现 mysql [...]]]></description>
		<wfw:commentRss>http://blog.goods-pro.com/1657/a-tool-to-synchronise-magento-database-between-servers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How magento deducts stock level</title>
		<link>http://blog.goods-pro.com/1446/how-magento-deducts-stock-level/</link>
		<comments>http://blog.goods-pro.com/1446/how-magento-deducts-stock-level/#comments</comments>
		<pubDate>Tue, 16 Mar 2010 20:42:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[小小草]]></category>
		<category><![CDATA[magento]]></category>
		<category><![CDATA[mysql]]></category>

		<guid isPermaLink="false">http://blog.goods-pro.com/?p=1446</guid>
		<description><![CDATA[我心里一直有个疑问，收到订单后，Magento 是怎么更新库存数量的？是直接用一个新库存数字去更新，还是用 upadte magento_cataloginventory_stock_item set qty=qty-qty_ordered 之类的办法。
通过跟踪 sql 语句，我感觉前者的可能性很大。

UPDATE `magento_cataloginventory_stock_item` SET `item_id` = '125', `product_id` = '125', `stock_id` = '1', `qty` = '93.000000', `min_qty` = '0.000000', `use_config_min_qty` = '1', `is_qty_decimal` = '0', `backorders` = '1', `use_config_backorders` = '0', `min_sale_qty` = '1.000000', `use_config_min_sale_qty` = '1', `max_sale_qty` = '0.000000', `use_config_max_sale_qty` = '1', `is_in_stock` = '1', `low_stock_date` = [...]]]></description>
		<wfw:commentRss>http://blog.goods-pro.com/1446/how-magento-deducts-stock-level/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mysql varchar could be transformed to memo in Ms Access</title>
		<link>http://blog.goods-pro.com/1353/mysql-varchar-can-be-transformed-to-memo-in-ms-access/</link>
		<comments>http://blog.goods-pro.com/1353/mysql-varchar-can-be-transformed-to-memo-in-ms-access/#comments</comments>
		<pubDate>Thu, 11 Feb 2010 11:29:42 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[小小草]]></category>
		<category><![CDATA[mysql]]></category>

		<guid isPermaLink="false">http://blog.goods-pro.com/?p=1353</guid>
		<description><![CDATA[Mysql varchar could be transformed to memo in Ms Access when Mysql table is used as linked table inside Access, but I want to prevent this from happening. Mainly because I can not join tables with memo field.
As I observed, long Mysql varchar field is transformed to memo field, but short one stays as text [...]]]></description>
		<wfw:commentRss>http://blog.goods-pro.com/1353/mysql-varchar-can-be-transformed-to-memo-in-ms-access/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Magento database fetch mode</title>
		<link>http://blog.goods-pro.com/1161/magento-database-fetch-mode/</link>
		<comments>http://blog.goods-pro.com/1161/magento-database-fetch-mode/#comments</comments>
		<pubDate>Wed, 14 Oct 2009 13:14:47 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[小小草]]></category>
		<category><![CDATA[magento]]></category>
		<category><![CDATA[mysql]]></category>

		<guid isPermaLink="false">http://blog.goods-pro.com/?p=1161</guid>
		<description><![CDATA[I was used to write $modelName-&#62;column_name to get attribute value in database. It requires $resource-&#62;_getReadAdapter()-&#62;setFetchMode(Zend_Db::FETCH_OBJ);.
However, it is not Magento&#8217;s default fetch mode (default is Zend_Db:FETCH_ASSOC). Whenever fetch mode is changed, it must be changed back to the default after using it. Otherwise, method getCollection() of ALL models will stop working. There may be other side [...]]]></description>
		<wfw:commentRss>http://blog.goods-pro.com/1161/magento-database-fetch-mode/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>mysql_update</title>
		<link>http://blog.goods-pro.com/1055/mysql_update/</link>
		<comments>http://blog.goods-pro.com/1055/mysql_update/#comments</comments>
		<pubDate>Tue, 11 Aug 2009 17:36:11 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[小小草]]></category>
		<category><![CDATA[mysql]]></category>

		<guid isPermaLink="false">http://blog.goods-pro.com/?p=1055</guid>
		<description><![CDATA[When using phpmyadmin, after select a database, then click on Privileges, you might run into a error saying
Unknown column &#8216;Event_priv&#8217; in &#8216;field list&#8217; 
The error will go after you run
mysql_upgrade
in command line.
I feel mysql query speed is improved after running &#8220;mysql_update&#8221;.
]]></description>
		<wfw:commentRss>http://blog.goods-pro.com/1055/mysql_update/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Speed bottleneck of the web server</title>
		<link>http://blog.goods-pro.com/1042/speed-bottleneck-of-the-web-server/</link>
		<comments>http://blog.goods-pro.com/1042/speed-bottleneck-of-the-web-server/#comments</comments>
		<pubDate>Tue, 04 Aug 2009 10:46:03 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[小小草]]></category>
		<category><![CDATA[cache]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://blog.goods-pro.com/?p=1042</guid>
		<description><![CDATA[非常典型的多层架构：
第一层 Nginx
第二层 php fastcgi
第三层 memcached
第四层 MySql
Apache 有个 mod_php，相当于合并了第一层和第二层，Nginx 没有 module for php，这不是什么问题，分层更利于扩展。第三层的加入完全是为了减轻数据库压力，提高性能。目前第2，3，4层之间的优化差不多到极限了（或者说到我能力的极限了），但第1，2层之间尚有潜力可挖。
not_in_use.php 和 not_in_use.html 都是一个静态文件，没有数据库操作。但 php 文件必须由 Nginx 经由 php fastcgi （使用 unix socket）产生，html 则由 Nginx 直接访问文件系统，就单因素分析，php fastcgi 是普通文件系统速度的34%，所以要想办法绕开 php fastcgi。以下测试在数据中心主机上直接运行 ApacheBench。
测试一：
$ ab -kc 100 -n 500 http://magento/not_in_use.php
This is ApacheBench, Version 2.0.40-dev  apache-2.0
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Copyright 2006 The Apache Software [...]]]></description>
		<wfw:commentRss>http://blog.goods-pro.com/1042/speed-bottleneck-of-the-web-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Zend_Db ignore default charset of Mysql</title>
		<link>http://blog.goods-pro.com/833/zenddb-ignore-default-charset-of-mysql/</link>
		<comments>http://blog.goods-pro.com/833/zenddb-ignore-default-charset-of-mysql/#comments</comments>
		<pubDate>Sat, 25 Apr 2009 23:17:16 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[小小草]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[utf-8]]></category>

		<guid isPermaLink="false">http://blog.goods-pro.com/?p=833</guid>
		<description><![CDATA[While I set my Mysql database default character set as UTF-8, Zend_Db_Adapter does not pick up the setting. Zend_Db write to Mysql using its own default character set (I guess it&#8217;s ISO-8859-1), unless it is specifically told by
$dbAdapter-&#62;query(&#8221;SET NAMES &#8216;utf8&#8242;&#8221;);
before
Zend_Db_Table::setDefaultAdapter($dbAdapter);
]]></description>
		<wfw:commentRss>http://blog.goods-pro.com/833/zenddb-ignore-default-charset-of-mysql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Quick access to data for both internet and intranet users</title>
		<link>http://blog.goods-pro.com/622/quick-access-to-data-for-both-internet-and-intranet-users/</link>
		<comments>http://blog.goods-pro.com/622/quick-access-to-data-for-both-internet-and-intranet-users/#comments</comments>
		<pubDate>Fri, 23 Jan 2009 20:06:55 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[小小草]]></category>
		<category><![CDATA[mysql]]></category>

		<guid isPermaLink="false">http://blog.goods-pro.com/?p=622</guid>
		<description><![CDATA[我曾思考过，也不止一次被人问过：数据中心的数据如何可以被公司员工快速存取？Internet users（客户、供应商、合作伙伴）通常存取单条数据，数据中心与internet users之间的传输速度足够满意；但intranet users（员工）经常存取批量数据，一般的宽带会让intranet users在存取数据时有大量的时滞。
难道在intranet建数据中心？小公司是负担不起的，最起码ADSL就得撤换成SDSL甚至更快的专线，最低档的SDSL（2M）也比ADSL贵十倍。在专业的数据中心可以以很低的成本实现100M到桌面，如果要不牺牲internet user experience，买条100M的专线，那是天价。
在成本不上升的情况下，如何让internet和intranet用户同时能快速访问数据？我曾想过Ajax，但觉得Ajax不是好的方案，因为Ajax只能缓解intranet users在等待数据时的焦虑心理，数据传输速度没有得到改善；我还想过分解数据表，把internet users经常用到的数据放在数据中心，把intranet suers经常用到的数据放在本地，但总有一些数据是双方都经常用到的，很难权衡该放在哪一端；而且对于一个现成的系统，分解数据表似乎不太现实。
今天我很高兴，因为我发现MySQL早就内置了数据同步功能（只是我孤陋寡闻罢了），只要几步简单设置，一个复杂的internet / intranet 矛盾就解决了，幸好我还没有走入Ajax和分解数据表的歧路。
做事一定要站得高看得远啊，这也是我说“多找软件、用好软件”的初衷。
]]></description>
		<wfw:commentRss>http://blog.goods-pro.com/622/quick-access-to-data-for-both-internet-and-intranet-users/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
