<?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>Tech Blog &#187; mysql</title>
	<atom:link href="http://informationideas.com/news/tag/mysql/feed/" rel="self" type="application/rss+xml" />
	<link>http://informationideas.com/news</link>
	<description>Using technology to help your business</description>
	<lastBuildDate>Tue, 06 Dec 2011 06:39:43 +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>Drop all tables in mysql without dropping database</title>
		<link>http://informationideas.com/news/2010/09/24/drop-all-tables-in-mysql-without-dropping-database/</link>
		<comments>http://informationideas.com/news/2010/09/24/drop-all-tables-in-mysql-without-dropping-database/#comments</comments>
		<pubDate>Fri, 24 Sep 2010 22:12:42 +0000</pubDate>
		<dc:creator>frank</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mysql]]></category>

		<guid isPermaLink="false">http://informationideas.com/news/?p=154</guid>
		<description><![CDATA[Found this brilliant method of doing just that via nix command. The reason why this is useful is that I generally don't like to type every table name into the sql command. mysqldump -u[USERNAME] -p[PASSWORD] --add-drop-table --no-data [DATABASE] &#124; grep ^DROP &#124; mysql -u[USERNAME] -p[PASSWORD] [DATABASE]]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop --><!-- End Shareaholic LikeButtonSetTop --><p>Found this brilliant method of doing just that via nix command.<br />
The reason why this is useful is that I generally don't like to type every table name into the sql command.</p>
<pre>mysqldump -u[USERNAME] -p[PASSWORD] --add-drop-table --no-data
[DATABASE] | grep ^DROP | mysql -u[USERNAME] -p[PASSWORD] [DATABASE]</pre>
<div class="shr-publisher-154"></div><!-- Start Shareaholic LikeButtonSetBottom --><!-- End Shareaholic LikeButtonSetBottom -->]]></content:encoded>
			<wfw:commentRss>http://informationideas.com/news/2010/09/24/drop-all-tables-in-mysql-without-dropping-database/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Update Delayed on Mysql and PHP</title>
		<link>http://informationideas.com/news/2008/12/11/update-delayed-on-mysql-and-php/</link>
		<comments>http://informationideas.com/news/2008/12/11/update-delayed-on-mysql-and-php/#comments</comments>
		<pubDate>Thu, 11 Dec 2008 23:10:12 +0000</pubDate>
		<dc:creator>frank</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[update delayed]]></category>

		<guid isPermaLink="false">http://informationideas.com/news/?p=68</guid>
		<description><![CDATA[Wouldn't it be nice if we could use UPDATE DELAYED in mysql just like we do use INSERT DELAYED? Unfortunately, the work around mysql created for this is to insert a record into the events table in order to separate UPDATE statement into another thread. There is a large overhead to inserting to then execute [...]]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop --><!-- End Shareaholic LikeButtonSetTop --><p>Wouldn't it be nice if we could use UPDATE DELAYED in mysql just like we do use INSERT DELAYED?  Unfortunately, the work around mysql created for this is to insert a record into the events table in order to separate UPDATE statement into another thread.  There is a large overhead to inserting to then execute an update.</p>
<p>If you are using PHP with mysql, there is another work around.Â  PHP has a function called, register_shutdown_function, which will execute a function during the shutdown of processing a script file.  So if we add an UPDATE LOW_PRIORITY sql statement wrapped in a function that is passed to register_shutdown_function, we can allow the user to receive the page without delay while the UPDATE statement waits until all locks on the table has been release before proceeding.<br />
<code><br />
function update_delayed()<br />
{<br />
    $sql = "UPDATE LOW_PRIORITY table_name SET col1 = 'something'";<br />
    mysql_query($sql, $conn);<br />
}</p>
<p>register_shutdown_function('update_delayed');<br />
</code></p>
<p>I wonder if there are even better ways to handle this problem.</p>
<div class="shr-publisher-68"></div><!-- Start Shareaholic LikeButtonSetBottom --><!-- End Shareaholic LikeButtonSetBottom -->]]></content:encoded>
			<wfw:commentRss>http://informationideas.com/news/2008/12/11/update-delayed-on-mysql-and-php/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Mysql on 32bit processor vs 64bit processor</title>
		<link>http://informationideas.com/news/2008/05/09/mysql-on-32bit-processor-vs-64bit-processor/</link>
		<comments>http://informationideas.com/news/2008/05/09/mysql-on-32bit-processor-vs-64bit-processor/#comments</comments>
		<pubDate>Fri, 09 May 2008 21:29:24 +0000</pubDate>
		<dc:creator>frank</dc:creator>
				<category><![CDATA[admin]]></category>
		<category><![CDATA[benchmark]]></category>
		<category><![CDATA[hardware]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[64bit]]></category>
		<category><![CDATA[processor]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://informationideas.com/news/2008/05/09/mysql-on-32bit-processor-vs-64bit-processor/</guid>
		<description><![CDATA[Here is the continuation of the experiment done previously on Mysql on Windows vs Linux. After doing more analysis and observation, it appeared that the difference in speed for the benchmark tests were not related to Windows and Linux but were related to the processor. The previous test just happened to have AMD 64s on [...]]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop --><!-- End Shareaholic LikeButtonSetTop --><p>Here is the continuation of the experiment done previously on <a href="http://informationideas.com/news/2008/05/01/mysql-on-windows-vs-linux/" title="Mysql on Windows vs Linux">Mysql on Windows vs Linux</a>.  After doing more analysis and observation, it appeared that the difference in speed for the benchmark tests were not related to Windows and Linux but were related to the processor.  The previous test just happened to have AMD 64s on the Linux machines and Intel Xeon 32bits on Windows.  We hypothesized that the increased throughput of the 64bit processors resulted in about half the time required to return the same query run on a 32bit machine.</p>
<p><a href="http://informationideas.com/news/2008/05/01/mysql-on-windows-vs-linux/" title="View the previous results">View the previous results</a></p>
<p>So we decided to test the same query again on a Windows machine with an AMD 64 X2.  This time the result for the query took 7.35 second, almost the same as the other AMD 64s running Linux.</p>
<p>One more test to run the query on a Windows Intel 64bit chip machine would better solidify our hypothesis.</p>
<div class="shr-publisher-50"></div><!-- Start Shareaholic LikeButtonSetBottom --><!-- End Shareaholic LikeButtonSetBottom -->]]></content:encoded>
			<wfw:commentRss>http://informationideas.com/news/2008/05/09/mysql-on-32bit-processor-vs-64bit-processor/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mysql server has gone away</title>
		<link>http://informationideas.com/news/2008/05/02/mysql-server-has-gone-away/</link>
		<comments>http://informationideas.com/news/2008/05/02/mysql-server-has-gone-away/#comments</comments>
		<pubDate>Sat, 03 May 2008 00:18:51 +0000</pubDate>
		<dc:creator>frank</dc:creator>
				<category><![CDATA[admin]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[closed connection]]></category>
		<category><![CDATA[database configuration]]></category>
		<category><![CDATA[mysql error]]></category>

		<guid isPermaLink="false">http://informationideas.com/news/2008/05/02/mysql-server-has-gone-away/</guid>
		<description><![CDATA[I have a spider crawling the web written in PHP running constantly to insert and update data in a Mysql database.Â  Today, it kept stopping on a records with the error message, "Mysql server has gone away".Â  It certainly did not time out as just starting the process again would result in this message immediately.Â  [...]]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop --><!-- End Shareaholic LikeButtonSetTop --><p>I have a spider crawling the web written in PHP running constantly to insert and update data in a Mysql database.Â  Today, it kept stopping on a records with the error message, "Mysql server has gone away".Â  It certainly did not time out as just starting the process again would result in this message immediately.Â  The script did not close out the connection to the DB as it had worked just fine for over a year.</p>
<p>Finally, I found that the problem was max_allowed_packet setting in my.cnf was too small.Â  It was set to 2MB and when Mysql receives a query larger than that, it assumes that something must have gone wrong and closes the connection.Â  I increased that parameter to 4MB and everything is working fine now.</p>
<div class="shr-publisher-48"></div><!-- Start Shareaholic LikeButtonSetBottom --><!-- End Shareaholic LikeButtonSetBottom -->]]></content:encoded>
			<wfw:commentRss>http://informationideas.com/news/2008/05/02/mysql-server-has-gone-away/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mysql on Windows vs Linux</title>
		<link>http://informationideas.com/news/2008/05/01/mysql-on-windows-vs-linux/</link>
		<comments>http://informationideas.com/news/2008/05/01/mysql-on-windows-vs-linux/#comments</comments>
		<pubDate>Fri, 02 May 2008 04:12:56 +0000</pubDate>
		<dc:creator>frank</dc:creator>
				<category><![CDATA[benchmark]]></category>
		<category><![CDATA[hardware]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[System]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[linux server]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[windows]]></category>
		<category><![CDATA[windows 2003]]></category>
		<category><![CDATA[windows server]]></category>

		<guid isPermaLink="false">http://informationideas.com/news/2008/05/01/mysql-on-windows-vs-linux/</guid>
		<description><![CDATA[I was working on optimizing a Mysql database today and accidentally stumbled upon a benchmarking exercise. The original Mysql database is hosted on a Windows Server 2003. I develop on a Mysql database server running on Ubuntu Linux. The Linux server ran the same query twice as fast as the Windows server without using caching [...]]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop --><!-- End Shareaholic LikeButtonSetTop --><p>I was working on optimizing a Mysql database today and accidentally stumbled upon a benchmarking exercise.  The original Mysql database is hosted on a Windows Server 2003.  I develop on a Mysql database server running on Ubuntu Linux.  The Linux server ran the same query twice as fast as the Windows server without using caching or anything.  I know that Linux does I/O caching on its own as well so I even tried running the query after a fresh reboot to rule out that factor.  Then I got help from a colleague and started tweaking with the my.cnf/my.ini to make sure they were the same and each time, the results came back about the same.  Mysql on Windows was consistently slower than Mysql on Linux.</p>
<p>Then we decided to load the database onto other servers for more data points on this Mysql performance test. We ran the same query returning 429 rows of data with 13 table joins and a couple of sub-queries.  All queries were run on the command line client on the servers themselves to avoid network lag.Â  All servers are running Mysql 5.0.x.</p>
<p><strong>Results</strong></p>
<p>1. Ubuntu Linux:                    0.70 seconds<br />
2. CentOS:                               0.78 seconds<br />
3. Windows 2003 Server:     1.40 seconds<br />
4. Windows 2003 Server:     1.42 seconds</p>
<p><strong>Server hardware</strong></p>
<p>1. Ubuntu Linux<br />
AMD ATHLON 64 X2 4200+<br />
2GB DDR400<br />
200GB 7200RPM SATA/150</p>
<p>2. CentOS<br />
Dual Opteron 240<br />
2GB DDR ECC<br />
120GB 7200RPM SATA/300</p>
<p>3. Windows 2003 Server<br />
Dual Xeon<br />
2GB DDR ECC<br />
7200RPM PATA</p>
<p>4. Windows 2003 Server<br />
2 Dual Xeon (4 CPUs)<br />
8GB DDR ECC<br />
3 73GB 10,000RPM SCSI in RAID 5</p>
<p><strong><a href="http://informationideas.com/news/2008/05/09/mysql-on-32bit-processor-vs-64bit-processor/">A followup to the benchmark that clarifies the cause of the differences</a></strong></p>
<div class="shr-publisher-47"></div><!-- Start Shareaholic LikeButtonSetBottom --><!-- End Shareaholic LikeButtonSetBottom -->]]></content:encoded>
			<wfw:commentRss>http://informationideas.com/news/2008/05/01/mysql-on-windows-vs-linux/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Mysql SQL_NO_CACHE Benchmark Problem</title>
		<link>http://informationideas.com/news/2008/02/25/mysql-sql_no_cache-benchmark-problem/</link>
		<comments>http://informationideas.com/news/2008/02/25/mysql-sql_no_cache-benchmark-problem/#comments</comments>
		<pubDate>Mon, 25 Feb 2008 23:57:00 +0000</pubDate>
		<dc:creator>frank</dc:creator>
				<category><![CDATA[admin]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[benchmark]]></category>
		<category><![CDATA[cache]]></category>

		<guid isPermaLink="false">http://informationideas.com/news/2008/02/25/mysql-sql_no_cache-benchmark-problem/</guid>
		<description><![CDATA[I have been trying to benchmark the sql calls to mysql from an application without success. Even when I set the SELECT statement to SQL_NO_CACHE, the results seemed to be still cached. Apparently, Linux does its own caching of disk reads also. That was giving me incorrect benchmark results if I hit the same data [...]]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop --><!-- End Shareaholic LikeButtonSetTop --><p>I have been trying to benchmark the sql calls to mysql from an application without success.  Even when I set the SELECT statement to SQL_NO_CACHE, the results seemed to be still cached.  Apparently, Linux does its own caching of disk reads also.  That was giving me incorrect benchmark results if I hit the same data twice.</p>
<p>For those using Linux kernel 2.6.16 or higher, you can <a href="http://dailyvim.blogspot.com/2008/02/drop-cache.html" target="_blank">clear Linux cache</a> with the following command.<br />
echo 3 &gt; /proc/sys/vm/drop_caches</p>
<p>Unfortunately for me, I am stuck on 2.5.xx and will have to figure out another method.</p>
<div class="shr-publisher-45"></div><!-- Start Shareaholic LikeButtonSetBottom --><!-- End Shareaholic LikeButtonSetBottom -->]]></content:encoded>
			<wfw:commentRss>http://informationideas.com/news/2008/02/25/mysql-sql_no_cache-benchmark-problem/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 1.850 seconds -->

