<?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>Albertech.net &#187; MySQL</title>
	<atom:link href="http://albertech.net/category/mysql/feed/" rel="self" type="application/rss+xml" />
	<link>http://albertech.net</link>
	<description>Tips, Tricks, and Reviews in Linux, Apache, MySQL, PHP</description>
	<lastBuildDate>Wed, 28 Jul 2010 16:09:13 +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>Disable autostart of MySQL in Debian and Ubuntu</title>
		<link>http://albertech.net/2010/07/disable-autostart-of-mysql-in-debian-and-ubuntu/</link>
		<comments>http://albertech.net/2010/07/disable-autostart-of-mysql-in-debian-and-ubuntu/#comments</comments>
		<pubDate>Wed, 07 Jul 2010 17:39:43 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[MySQL debian autostart]]></category>

		<guid isPermaLink="false">http://albertech.net/?p=427</guid>
		<description><![CDATA[The quickest way to disable autostart of services in Debian is to utilize a convenient curses interface to selectively choose which services to autostart in different run levels. Its so much easier to use than update-rc.d.  Its good for instances where you are migrating services out of an existing box, such as removing the mysql server without uninstalling.

The package is called:
<strong>sysv-rc-conf</strong>

(Install it using aptitude or apt-get install)]]></description>
			<content:encoded><![CDATA[
<div class="topsy_widget_data topsy_theme_blue" style="float: right;margin-left: 0.75em; background: url(data:,%7B%20%22url%22%3A%20%22http%253A%252F%252Falbertech.net%252F2010%252F07%252Fdisable-autostart-of-mysql-in-debian-and-ubuntu%252F%22%2C%20%22shorturl%22%3A%20%22http%3A%2F%2Fbit.ly%2Far1T10%22%2C%20%22style%22%3A%20%22big%22%2C%20%22title%22%3A%20%22Disable%20autostart%20of%20MySQL%20in%20Debian%20and%20Ubuntu%22%20%7D);"></div>
<p>The quickest way to disable autostart of services in Debian is to utilize a convenient curses interface to selectively choose which services to autostart in different run levels. Its so much easier to use than update-rc.d.  Its good for instances where you are migrating services out of an existing box, such as removing the mysql server without uninstalling.</p>
<p>The package is called:<br />
<strong>sysv-rc-conf</strong></p>
<p>(Install it using aptitude or apt-get install)</p>

]]></content:encoded>
			<wfw:commentRss>http://albertech.net/2010/07/disable-autostart-of-mysql-in-debian-and-ubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fix: MySQL Error Illegal mix of collations</title>
		<link>http://albertech.net/2010/04/fix-mysql-error-illegal-mix-of-collations/</link>
		<comments>http://albertech.net/2010/04/fix-mysql-error-illegal-mix-of-collations/#comments</comments>
		<pubDate>Mon, 12 Apr 2010 20:00:49 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[mysql character set]]></category>

		<guid isPermaLink="false">http://albertech.net/?p=395</guid>
		<description><![CDATA[<strong>The error message looked like:</strong>
"Illegal mix of collations (latin1_swedish_ci,COERCIBLE) and   (utf8_general_ci,IMPLICIT) for operation 'find_in_set'"

I ran into this problem today while importing text from a CSV file. Evidently, the text format of the document had UTF characters, which caused CodeIgniter to error out when it tried to insert it to the database. The line had French characters (The ç in Français) My database fields by default are set to "<dfn title="Swedish, case-insensitive">latin1_swedish_ci</dfn>" character set.

<strong>The fix?
</strong>I decided the best way to fix this was to set the Collation option for that specific field in the MySQL database to  "utf8_general_ci<dfn title="Unicode (multilingual), ... ]]></description>
			<content:encoded><![CDATA[
<div class="topsy_widget_data topsy_theme_blue" style="float: right;margin-left: 0.75em; background: url(data:,%7B%20%22url%22%3A%20%22http%253A%252F%252Falbertech.net%252F2010%252F04%252Ffix-mysql-error-illegal-mix-of-collations%252F%22%2C%20%22shorturl%22%3A%20%22http%3A%2F%2Fbit.ly%2FdaKy1N%22%2C%20%22style%22%3A%20%22big%22%2C%20%22title%22%3A%20%22Fix%3A%20MySQL%20Error%20Illegal%20mix%20of%20collations%22%20%7D);"></div>
<p><strong>The error message looked like:</strong><br />
&#8220;Illegal mix of collations (latin1_swedish_ci,COERCIBLE) and   (utf8_general_ci,IMPLICIT) for operation &#8216;find_in_set&#8217;&#8221;</p>
<p>I ran into this problem today while importing text from a CSV file. Evidently, the text format of the document had UTF characters, which caused CodeIgniter to error out when it tried to insert it to the database. The line had French characters (The ç in Français) My database fields by default are set to &#8220;<dfn title="Swedish, case-insensitive">latin1_swedish_ci</dfn>&#8221; character set.</p>
<p><strong>The fix?<br />
</strong>I decided the best way to fix this was to set the Collation option for that specific field in the MySQL database to  &#8220;utf8_general_ci<dfn title="Unicode (multilingual), case-insensitive"></dfn>&#8221; from &#8220;latin1_bin&#8221;. Re-import the data back into the database and it should preserve the character set. Its a good idea to set text fields to UTF-8, especially if you anticipate getting UTF characters.</p>

]]></content:encoded>
			<wfw:commentRss>http://albertech.net/2010/04/fix-mysql-error-illegal-mix-of-collations/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL &#8211; Case insensitive ORDER BY</title>
		<link>http://albertech.net/2010/03/mysql-case-insensitive-order-by/</link>
		<comments>http://albertech.net/2010/03/mysql-case-insensitive-order-by/#comments</comments>
		<pubDate>Wed, 03 Mar 2010 18:37:46 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[mysql case insensitive]]></category>

		<guid isPermaLink="false">http://albertech.net/?p=372</guid>
		<description><![CDATA[MySQL by default will make the ORDER BY option in queries case sensitive. This means that rows with the same starting letters (but different case) may be ordered non-alphabetically. There are three solutions to this. One is to force all database entries to be forced to upper-case or lower-case when inserting. Another is to use the collate option. The other solution is to change the query itself.]]></description>
			<content:encoded><![CDATA[
<div class="topsy_widget_data topsy_theme_blue" style="float: right;margin-left: 0.75em; background: url(data:,%7B%20%22url%22%3A%20%22http%253A%252F%252Falbertech.net%252F2010%252F03%252Fmysql-case-insensitive-order-by%252F%22%2C%20%22shorturl%22%3A%20%22http%3A%2F%2Fbit.ly%2F9Xa4p3%22%2C%20%22style%22%3A%20%22big%22%2C%20%22title%22%3A%20%22MySQL%20-%20Case%20insensitive%20ORDER%20BY%22%20%7D);"></div>
<p>MySQL by default will make the ORDER BY option in queries case sensitive. This means that rows with the same starting letters (but different case) may be ordered non-alphabetically. There are three solutions to this. One is to force all database entries to be forced to upper-case or lower-case when inserting. Another is to use the collate option. The other solution is to change the query itself.</p>
<p><strong>Option 2</strong> (Thanks to <strong>eremit)<br />
</strong>mysql_query(“SELECT * FROM names ORDER BY name COLLATE ‘latin1_general_ci’);</p>
<p>See: <a rel="nofollow" href="http://dev.mysql.com/doc/refman/5.0/en/case-sensitivity.html" target="_blank">MySQL Reference – Case Sensitivity in String Searches</a> and <a rel="nofollow" href="http://dev.mysql.com/doc/refman/5.0/en/charset.html" target="_blank">MySQL Reference – Character Set Support</a></p>
<p><strong>Option 3:</strong></p>
<p>The MySQL query for case insensitive ORDER BY is to add the<strong> LOWER()</strong> to your field name. For instance:</p>
<p>mysql_query(&#8220;SELECT * FROM names ORDER BY lastname&#8221;);</p>
<p>will be: mysql_query(&#8220;SELECT * FROM names ORDER BY <strong>LOWER(</strong>lastname<strong>)</strong>&#8220;);</p>

]]></content:encoded>
			<wfw:commentRss>http://albertech.net/2010/03/mysql-case-insensitive-order-by/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>MySQL Tutorial: Fetch last 10 rows without reversing order</title>
		<link>http://albertech.net/2010/01/mysql-tutorial-fetch-last-10-rows-without-reversing-order/</link>
		<comments>http://albertech.net/2010/01/mysql-tutorial-fetch-last-10-rows-without-reversing-order/#comments</comments>
		<pubDate>Tue, 05 Jan 2010 21:57:39 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[limit]]></category>
		<category><![CDATA[order by]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://albertech.net/?p=330</guid>
		<description><![CDATA[Here's the quickest way to sort data in MySQL after retrieving the last 10 entries with the LIMIT and ORDER BY DESC commands. If you simply do a ORDER BY DESC LIMIT 10, this will return the last 10 results in reverse order (newest first). Adding an inline SELECT command will sort the results after retrieving the last 10 items. (oldest first)

<B>SQL Command</B>

$sql = &#34;SELECT * FROM &#40;SELECT * FROM [TABLE] WHERE ORDER BY modified_date DESC LIMIT 10&#41; AS tbl ORDER BY tbl.modified_date&#34;



This will retrieve the last 10 rows while sorting by date chronologically. I used this SQL command for ... ]]></description>
			<content:encoded><![CDATA[
<div class="topsy_widget_data topsy_theme_blue" style="float: right;margin-left: 0.75em; background: url(data:,%7B%20%22url%22%3A%20%22http%253A%252F%252Falbertech.net%252F2010%252F01%252Fmysql-tutorial-fetch-last-10-rows-without-reversing-order%252F%22%2C%20%22style%22%3A%20%22big%22%2C%20%22title%22%3A%20%22MySQL%20Tutorial%3A%20Fetch%20last%2010%20rows%20without%20reversing%20order%22%20%7D);"></div>
<p>Here&#8217;s the quickest way to sort data in MySQL after retrieving the last 10 entries with the LIMIT and ORDER BY DESC commands. If you simply do a ORDER BY DESC LIMIT 10, this will return the last 10 results in reverse order (newest first). Adding an inline SELECT command will sort the results after retrieving the last 10 items. (oldest first)</p>
<p><B>SQL Command</B></p>
<p>$sql = &quot;SELECT * FROM &#40;SELECT * FROM [TABLE] WHERE ORDER BY modified_date DESC LIMIT 10&#41; AS tbl ORDER BY tbl.modified_date&quot;</p>
<p>This will retrieve the last 10 rows while sorting by date chronologically. I used this SQL command for the graphing API I was using (<a href="http://naku.dohcrew.com/libchart">LibChart</a>). This allowed my graph to display the most current data on the right side as opposed to the left.</p>

]]></content:encoded>
			<wfw:commentRss>http://albertech.net/2010/01/mysql-tutorial-fetch-last-10-rows-without-reversing-order/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL: Avoiding the Mysql:Too many connections error</title>
		<link>http://albertech.net/2009/07/mysql-avoiding-the-mysqltoo-many-connections-error/</link>
		<comments>http://albertech.net/2009/07/mysql-avoiding-the-mysqltoo-many-connections-error/#comments</comments>
		<pubDate>Fri, 17 Jul 2009 19:37:56 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[too many connections]]></category>
		<category><![CDATA[wait_timeout]]></category>

		<guid isPermaLink="false">http://albertech.net/?p=208</guid>
		<description><![CDATA[ If your site experiences the infamous "Mysql : Too many connections" error, you will need to tune your MySQL server to handle the load of a heavily used website. 

There are some configuration variables that you can adjust to make your site handle more connections.
The wait_timeout default in MySQL is 28840 seconds (8 hours), which can seriously limit the number of open connections you have on your page. I adjusted mine to 60 seconds. This frees up the thread after idle timeout, which allows for more connections to connect. The 8 hour timeframe is fine if you only have a few connections to the server. For popular websites, its best to make this value as low as possible. Set this variable to the maximum time your page typically runs. For instance, if you have a page that needs to retrieve some data processed from another server (60-80 seconds) and you only use one mysql_connect, you may lose the mysql connection for processing the remaining parts of the page if your wait_timeout is too low. If the processing takes much longer, a workaround is to use multiple mysql_connects to prevent an idle connection from disconnecting.
]]></description>
			<content:encoded><![CDATA[
<div class="topsy_widget_data topsy_theme_blue" style="float: right;margin-left: 0.75em; background: url(data:,%7B%20%22url%22%3A%20%22http%253A%252F%252Falbertech.net%252F2009%252F07%252Fmysql-avoiding-the-mysqltoo-many-connections-error%252F%22%2C%20%22style%22%3A%20%22big%22%2C%20%22title%22%3A%20%22MySQL%3A%20Avoiding%20the%20Mysql%3AToo%20many%20connections%20error%22%20%7D);"></div>
<p> <strong>If your site experiences the infamous &#8220;Mysql : Too many connections&#8221; error, you will need to tune your MySQL server to handle the load of a heavily used website.</strong> </p>
<p> There are some configuration variables that you can adjust to make your site handle more connections.</p>
<ul>
<li>An easy way to identify which variables need to be changed can be done through phpMyAdmin. Login to your phpMyAdmin control panel and search for the &#8220;<strong>Show MySQL runtime information</strong>&#8221; module. Scroll down the page and look for entries that are in <span style="color: #ff0000;">red. <span style="color: #000000;">These are suggested areas in your MySQL configuration that need to be looked at.
<p></span></span></li>
<li><span style="color: #ff0000;"><span style="color: #000000;">The<strong> wait_timeout </strong>default in MySQL is <strong>28840 seconds</strong> (8 hours), which can seriously limit the number of open connections you have on your page. I adjusted mine to<strong> 60 seconds</strong>. This frees up the thread after idle timeout, which allows for more connections to connect. The 8 hour timeframe is fine if you only have a few connections to the server. For popular websites, its best to make this value as low as possible. Set this variable to the maximum time your page typically runs. For instance, if you have a page that needs to retrieve some data processed from another server (60-80 seconds) and you only use one mysql_connect, you may lose the mysql connection for processing the remaining parts of the page if your wait_timeout is too low. If the processing takes much longer, a workaround is to use multiple mysql_connects to prevent an idle connection from disconnecting.
<p></span></span></li>
<li><span style="color: #ff0000;"><span style="color: #000000;"><strong>DNS issues</strong>. If your DNS suddenly stops working, this will consume all your MySQL connections. MySQL tries to resolve the IP address for every connection it gets, so this will start creating many more threads than released if it DNS is down. In Linux, edit the <strong>/etc/hosts</strong> file and manually add in your web server IPs/names to this (if you have static IPs) This will speed up performance by resolving IPs locally as opposed to through DNS. You can identify DNS issues or connection attempts through &#8220;<strong>Failed attempts</strong>&#8221; section in phpMyAdmin runtime page. A significant number of failed attempts can mean either someone is trying to break into your MySQL box or your DNS isn&#8217;t working right.
<p></span></span></li>
<li><span style="color: #ff0000;"><span style="color: #000000;">Increase the <strong>key_buffer</strong> value (for MyISAM tables) This helps handle indexes for temporary tables. If you have lots of key misses, its important to increase the size of the key_buffer. You can do this by comparing the key_reads vs. key_read_requests value.
<p></span></span></li>
<li><span style="color: #ff0000;"><span style="color: #000000;">Increase the <strong>innodb_buffer_pool_size</strong> (for innodb tables)
<p></span></span></li>
<li><span style="color: #ff0000;"><span style="color: #000000;">Increase the <strong>table_cache</strong> value. If you look at your phpMyAdmin runtime &#8220;Opened_tables&#8221; field and see a large number (over 1,000) you will need to increase your table_cache. This will keep tables in memory to speed up peformance. Default is only 64. I&#8217;ve upped mine to over 2,000 since I have many databases and tables running on my server.
<p></span></span></li>
<li><span style="color: #ff0000;"><span style="color: #000000;">For more information, check out these resources:<br />
<a href="http://www.ibm.com/developerworks/linux/library/l-tune-lamp-3.html">http://www.ibm.com/developerworks/linux/library/l-tune-lamp-3.html</a> <br />
</span></span><span style="color: #ff0000;"><span style="color: #000000;"><a href="http://dev.mysql.com/tech-resources/presentations/presentation-oscon2000-20000719/index.html">http://dev.mysql.com/tech-resources/presentations/presentation-oscon2000-20000719/index.html</a></span></span></li>
</ul>
<p><strong> </strong></p>

]]></content:encoded>
			<wfw:commentRss>http://albertech.net/2009/07/mysql-avoiding-the-mysqltoo-many-connections-error/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Quick tuning MySQL performance</title>
		<link>http://albertech.net/2009/06/quick-tuning-mysql-performance/</link>
		<comments>http://albertech.net/2009/06/quick-tuning-mysql-performance/#comments</comments>
		<pubDate>Fri, 12 Jun 2009 01:32:24 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[throttle]]></category>
		<category><![CDATA[tuning]]></category>

		<guid isPermaLink="false">http://albertech.net/?p=186</guid>
		<description><![CDATA[I've been working on tuning my Apache/MySQL/PHP configuration lately to see how to improve the performance. Lately, I've been noticing some crawlers that have been ignoring my robots.txt file and hitting my server really hard with several page requests every second. So, I decided to run some tests to see where I could speed up my website in the code. ]]></description>
			<content:encoded><![CDATA[
<div class="topsy_widget_data topsy_theme_blue" style="float: right;margin-left: 0.75em; background: url(data:,%7B%20%22url%22%3A%20%22http%253A%252F%252Falbertech.net%252F2009%252F06%252Fquick-tuning-mysql-performance%252F%22%2C%20%22style%22%3A%20%22big%22%2C%20%22title%22%3A%20%22Quick%20tuning%20MySQL%20performance%22%20%7D);"></div>
<p>I&#8217;ve been working on tuning my Apache/MySQL/PHP configuration lately to see how to improve the performance. Lately, I&#8217;ve been noticing some crawlers (same IPs all the time) that have been ignoring my robots.txt file and hitting my server really hard with several page requests every second.</p>
<p>So, I decided to run some tests to see where I could speed up my website in the code.</p>
<p>One test was significant. I commented one update statement in my code and that sped up my page 3 times. Page display time went down from 0.15 second to 0.045 second! It seems as though my VMWARE server has slow write access times in comparison to reads, so this is a source of the cause. I decided to use this to my advantage.  So, basically create an array with the blacklisted IPs (but you can&#8217;t block them entirely since I need certain crawlers to index websites/etc. for searches)</p>
<p><code>$is_crawler = 0;<br />
$crawler_array = array("[CRAWLER IP]","[CRAWLER IP2]");<br />
foreach($crawler_array as $crawler_item)<br />
{<br />
if ($crawler_item == $current_ip)<br />
{<br />
$is_crawler = 1;<br />
break;<br />
}<br />
}</code></p>
<p>In using this, only run the update query if the source IP isn&#8217;t a crawler&#8230; so something like this:<br />
<code><br />
if ($is_crawler==0)<br />
{</code><code><br />
// Run MySQL Update command<br />
}  </code></p>
<p>Other ways to speed up your MySQL performance.</p>
<ul>
<li>Only use ORDER BY when necessary. Ordering is costly with large datasets</li>
<li>Joins are costly as well. Design a database table cache that has the union set if performance is a concern</li>
<li>Memcache is a viable option as well for pages that use many tables to generate the page.</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://albertech.net/2009/06/quick-tuning-mysql-performance/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Wordpress MU 2.7 Review</title>
		<link>http://albertech.net/2009/03/wordpress-mu-27-review/</link>
		<comments>http://albertech.net/2009/03/wordpress-mu-27-review/#comments</comments>
		<pubDate>Wed, 18 Mar 2009 00:42:58 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[review]]></category>
		<category><![CDATA[wordpress MU 2.7]]></category>

		<guid isPermaLink="false">http://albertech.net/?p=122</guid>
		<description><![CDATA[WordPress introduced a new version of its multi-user blog software in January 2009. I have been using version 2.6 for the past few months and it was working well, although the site management was very confusing to use. Version 2.7 fixes this problem by making the Site Admin menu more uniform with the main dashboard. 
]]></description>
			<content:encoded><![CDATA[
<div class="topsy_widget_data topsy_theme_blue" style="float: right;margin-left: 0.75em; background: url(data:,%7B%20%22url%22%3A%20%22http%253A%252F%252Falbertech.net%252F2009%252F03%252Fwordpress-mu-27-review%252F%22%2C%20%22style%22%3A%20%22big%22%2C%20%22title%22%3A%20%22Wordpress%20MU%202.7%20Review%22%20%7D);"></div>
<div id="attachment_123" class="wp-caption alignnone" style="width: 410px"><img class="size-full wp-image-123" title="wordpress_mu" src="http://albertech.net/wp-content/uploads/2009/03/wordpress_mu.jpg" alt="Wordpress Mu Control Panel" width="400" height="269" /><p class="wp-caption-text">Wordpress MU Control Panel</p></div>
<p>WordPress introduced a new version of its multi-user blog software in January 2009. I have been using version 2.6 for the past few months and it was working well, although the site management was very confusing to use. Version 2.7 fixes this problem by making the Site Admin menu more uniform with the main dashboard.</p>
<p>The Site Admin is now located on the left hand menu, which is much easier to access than 2.6. (previously on the right side of the control panel. There are six options: Admin, Blogs, Users, Themes, Options, and Upgrade. Pretty straight-forward.</p>
<p><strong>Admin: </strong>Create new blogs<br />
<strong>Blogs:</strong> View each of the blogs, its users, links to edit/de-activate<br />
<strong>Users:</strong> Manage what each of the users can see/edit/role<br />
<strong>Themes:</strong> Themes available for blogs.<br />
<strong>Site Options:</strong> Security/Global settings for WordPress<br />
<strong>Upgrade: </strong>This is used to upgrade the WordPress version on the individual blogs. You still need to manually copy the latest version of WordPress MU into the folder when a new version comes out. In contrast, the standalone WordPress has a button that will automatically fetch the source and install the latest version for you.</p>
<p><strong>What I like about the new version:</strong><br />
A lot of the things I like about WordPress 2.7, I like it on WordPress MU. Major Upgrades with 2.7 vs. 2.6 include: QuickPress publishing features for quick posting, 1 click upgrade, and all new navigation system on the dashboard.</p>
<div class="mceTemp">
<div id="attachment_128" class="wp-caption alignnone" style="width: 417px"><img class="size-full wp-image-128" title="sitethemes" src="http://albertech.net/wp-content/uploads/2009/03/sitethemes.jpg" alt="Site Themes Control Panel" width="407" height="214" /><p class="wp-caption-text">Site Themes Control Panel</p></div>
<p> </p>
<div id="attachment_126" class="wp-caption alignnone" style="width: 417px"><img class="size-full wp-image-126" title="quickpost" src="http://albertech.net/wp-content/uploads/2009/03/quickpost.jpg" alt="Quick Post Feature" width="407" height="242" /><p class="wp-caption-text">Quick Post Feature</p></div>
</div>
<p>There is also redundant menu options on the top menu in WordPress MU. This allows you to quickly switch between different blogs. So, switching between blogs is a one click process vs. a multiple click previously in 2.6. </p>
<div id="attachment_131" class="wp-caption alignnone" style="width: 413px"><img class="size-full wp-image-131" title="toptoolbar" src="http://albertech.net/wp-content/uploads/2009/03/toptoolbar.jpg" alt="Top Toolbar for WordPress MU" width="403" height="25" /><p class="wp-caption-text">Top Toolbar for WordPress MU</p></div>
<p><strong>Verdict:</strong><br />
WordPress MU 2.7 is definitely worth considering with the new dashboard layout. The main advantage of having MU is that you have the ability to control the settings of all blogs. You can control what themes can be used, ban certain email addresses from registering, control permissions, and set the default welcome email. There is a built-in quota manager for each blog, so you can limit the disk space usage of all blogs. You can also limit the types of files that a user can upload on a blog &#8212; such as limiting attachments to PDF, Word Documents, or images. Another advantage of the MU is that you only need to upgrade the blog software in 1 place for several blogs. User management is good, but there still needs to be a way to add a user to multiple blogs in one screen. </p>
<p>Overall, WordPress MU 2.7 is great resource if you need to support several blogs (blog network) and are a fan of the standalone WordPress software.<br />
WordPress MU Support Forums<br />
<a href="http://mu.wordpress.org/forums/">http://mu.wordpress.org/forums/</a></p>
<p>WordPress MU Download<br />
<a href="http://mu.wordpress.org/download/">http://mu.wordpress.org/download/</a></p>

]]></content:encoded>
			<wfw:commentRss>http://albertech.net/2009/03/wordpress-mu-27-review/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Preventing MySQL injection with PHP</title>
		<link>http://albertech.net/2009/03/preventing-mysql-injection-with-php/</link>
		<comments>http://albertech.net/2009/03/preventing-mysql-injection-with-php/#comments</comments>
		<pubDate>Thu, 12 Mar 2009 22:13:14 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[prevent injection]]></category>

		<guid isPermaLink="false">http://albertech.net/?p=110</guid>
		<description><![CDATA[<strong>A good practice is to check input strings to make sure users don't put in mySQL commands in your server.</strong> For instance, if a username or password POST variable isn't filtered, there is a potential for an injection like 'OR myusername='. In the past, I've been using my own PHP toolkit to "clean" the input variables. But recently, I began searching to see if there are a built-in solution in PHP for this, especially since I'm converting a script written in Python that had the filter <B>MySQLdb.escape_string</B>. Enter <a href="http://us2.php.net/manual/en/function.mysql-real-escape-string.php">mysql_real_escape_string()</a>]]></description>
			<content:encoded><![CDATA[
<div class="topsy_widget_data topsy_theme_blue" style="float: right;margin-left: 0.75em; background: url(data:,%7B%20%22url%22%3A%20%22http%253A%252F%252Falbertech.net%252F2009%252F03%252Fpreventing-mysql-injection-with-php%252F%22%2C%20%22style%22%3A%20%22big%22%2C%20%22title%22%3A%20%22Preventing%20MySQL%20injection%20with%20PHP%22%20%7D);"></div>
<p><strong>A good practice is to check input strings to make sure users don&#8217;t put in mySQL commands in your server.</strong> For instance, if a username or password POST variable isn&#8217;t filtered, there is a potential for an injection like &#8216;OR myusername=&#8217;. In the past, I&#8217;ve been using my own PHP toolkit to &#8220;clean&#8221; the input variables. But recently, I began searching to see if there are a built-in solution in PHP for this, especially since I&#8217;m converting a script written in Python that had the filter <B>MySQLdb.escape_string</B>. Enter <a href="http://us2.php.net/manual/en/function.mysql-real-escape-string.php">mysql_real_escape_string()</a></p>
<p>1) Step 1: Filter out the backtick character, ` which is often used in mySQL to denote field names<br />
<code><br />
$variable = str_replace("`","",$variable);<br />
</code></p>
<p>2) Step 2: If its a username or password field which does not have a space, you should use ctype_alnum  This will determine whether there is a character thats not alphanumeric or numeric. So, spaces will not work.<br />
<code><br />
if (ctype_alnum($variable))<br />
{<br />
   //allowed variable<br />
}<br />
</code></p>
<p>3) Step 3: Use the mysql_real_escape_string as long as it exists on your server. If it doesn&#8217;t exist, an error message will display. I suggest upgrading your PHP if possible since this function will take care of different character sets/etc. You can use this function after the mySQL connection has been initialized.<br />
<code><br />
if(function_exists("mysql_real_escape_string"))<br />
{<br />
   $variable = mysql_real_escape_string(htmlspecialchars($variable, ENT_QUOTES));<br />
}<br />
else<br />
{<br />
    echo "mysql_real_escpe_string does not exist on the server. Upgrade PHP to the latest version.";<br />
}<br />
</code></p>

]]></content:encoded>
			<wfw:commentRss>http://albertech.net/2009/03/preventing-mysql-injection-with-php/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Converting MySQL datetime to any format</title>
		<link>http://albertech.net/2009/03/converting-mysql-datetime-to-any-format/</link>
		<comments>http://albertech.net/2009/03/converting-mysql-datetime-to-any-format/#comments</comments>
		<pubDate>Sun, 01 Mar 2009 05:54:59 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[datetime]]></category>
		<category><![CDATA[format]]></category>

		<guid isPermaLink="false">http://albertech.net/?p=95</guid>
		<description><![CDATA[Converting the datetime format is really simple if you let MySQL do the formatting for you.

<a title="MySQL 5.1 Date and Time Functions" href="http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html#function_date-format">MySQL 5.1 SELECT DATE_FORMAT manual</a>

For instance, if you wanted to convert the datetime into something that reads
<code>function ConvertNiceDateOnly($date)
{
// Convert mySQL date to nice formatted date
$normaldate = mysql_query("SELECT DATE_FORMAT('$date','%M %e, %Y')");
$normaldate = mysql_fetch_row($normaldate);
$normaldate = $normaldate[0];
return $normaldate;
}
</code>]]></description>
			<content:encoded><![CDATA[
<div class="topsy_widget_data topsy_theme_blue" style="float: right;margin-left: 0.75em; background: url(data:,%7B%20%22url%22%3A%20%22http%253A%252F%252Falbertech.net%252F2009%252F03%252Fconverting-mysql-datetime-to-any-format%252F%22%2C%20%22style%22%3A%20%22big%22%2C%20%22title%22%3A%20%22Converting%20MySQL%20datetime%20to%20any%20format%22%20%7D);"></div>
<p>Converting the datetime format is really simple if you let MySQL do the formatting for you.</p>
<p><a title="MySQL 5.1 Date and Time Functions" href="http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html#function_date-format">MySQL 5.1 SELECT DATE_FORMAT manual</a></p>
<p>For instance, if you wanted to convert the datetime into something that reads<br />
<code>function ConvertNiceDateOnly($date)<br />
{<br />
// Convert mySQL date to nice formatted date<br />
$normaldate = mysql_query("SELECT DATE_FORMAT('$date','%M %e, %Y')");<br />
$normaldate = mysql_fetch_row($normaldate);<br />
$normaldate = $normaldate[0];<br />
return $normaldate;<br />
}<br />
</code></p>

]]></content:encoded>
			<wfw:commentRss>http://albertech.net/2009/03/converting-mysql-datetime-to-any-format/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP &#8211; MySQL datetime to seconds</title>
		<link>http://albertech.net/2009/01/php-mysql-datetime-to-seconds/</link>
		<comments>http://albertech.net/2009/01/php-mysql-datetime-to-seconds/#comments</comments>
		<pubDate>Tue, 27 Jan 2009 02:53:51 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[datetime to seconds]]></category>

		<guid isPermaLink="false">http://albertech.net/?p=59</guid>
		<description><![CDATA[<strong>$unixseconds = strtotime($mysqldate);</strong>

For instance, you can use this to write a timeout script for login failures. Usually, a system should lock after 3-5 consecutive failed login attempts. I save the timestamp after the 5th consecutive login failure, then run a check on this timestamp if the current time is within the ~5-10 minute lockout window. 5 minutes is 300 seconds, 10 minutes is 600 seconds.]]></description>
			<content:encoded><![CDATA[
<div class="topsy_widget_data topsy_theme_blue" style="float: right;margin-left: 0.75em; background: url(data:,%7B%20%22url%22%3A%20%22http%253A%252F%252Falbertech.net%252F2009%252F01%252Fphp-mysql-datetime-to-seconds%252F%22%2C%20%22style%22%3A%20%22big%22%2C%20%22title%22%3A%20%22PHP%20-%20MySQL%20datetime%20to%20seconds%22%20%7D);"></div>
<p><strong>$unixseconds = strtotime($mysqldate);</strong></p>
<p>For instance, you can use this to write a timeout script for login failures. Usually, a system should lock after 3-5 consecutive failed login attempts. I save the timestamp after the 5th consecutive login failure, then run a check on this timestamp if the current time is within the ~5-10 minute lockout window. 5 minutes is 300 seconds, 10 minutes is 600 seconds.</p>

]]></content:encoded>
			<wfw:commentRss>http://albertech.net/2009/01/php-mysql-datetime-to-seconds/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL &#8211; rename a database</title>
		<link>http://albertech.net/2008/12/mysql-rename-a-database/</link>
		<comments>http://albertech.net/2008/12/mysql-rename-a-database/#comments</comments>
		<pubDate>Tue, 30 Dec 2008 19:16:31 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[rename database]]></category>

		<guid isPermaLink="false">http://albertech.net/?p=51</guid>
		<description><![CDATA[I looked through the documentation on MySQL and it looks like they removed the "rename database" option. Here's a workaround:

<strong>mysqladmin create [Name of new database]
mysqldump --opt [Name of old database] &#124; mysql [Name of new database]</strong>]]></description>
			<content:encoded><![CDATA[
<div class="topsy_widget_data topsy_theme_blue" style="float: right;margin-left: 0.75em; background: url(data:,%7B%20%22url%22%3A%20%22http%253A%252F%252Falbertech.net%252F2008%252F12%252Fmysql-rename-a-database%252F%22%2C%20%22style%22%3A%20%22big%22%2C%20%22title%22%3A%20%22MySQL%20-%20rename%20a%20database%22%20%7D);"></div>
<p>I looked through the documentation on MySQL and it looks like they removed the &#8220;rename database&#8221; option. Here&#8217;s a workaround:</p>
<p><strong>mysqladmin create [Name of new database]<br />
mysqldump &#8211;opt [Name of old database] | mysql [Name of new database]</strong></p>

]]></content:encoded>
			<wfw:commentRss>http://albertech.net/2008/12/mysql-rename-a-database/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Reset MySQL auto increment to 1</title>
		<link>http://albertech.net/2008/12/reset-mysql-auto-increment-to-1/</link>
		<comments>http://albertech.net/2008/12/reset-mysql-auto-increment-to-1/#comments</comments>
		<pubDate>Thu, 11 Dec 2008 20:04:10 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[auto_increment]]></category>
		<category><![CDATA[primary key]]></category>
		<category><![CDATA[reset]]></category>
		<category><![CDATA[truncate]]></category>

		<guid isPermaLink="false">http://albertech.net/?p=47</guid>
		<description><![CDATA[Here's a quick reference to reset the MySQL auto_increment field to 1 and <strong>delete</strong> <strong>ALL rows in a table</strong>. This is useful in case you had to do some testing and wanted to reset the primary key field back to 1 and clear out the table.

<code>truncate table [NAME OF TABLE]</code>

If you don't want to wipe out the table, you can reset the auto_increment by using:

<code>alter table [NAME OF TABLE] auto_increment=1</code>]]></description>
			<content:encoded><![CDATA[
<div class="topsy_widget_data topsy_theme_blue" style="float: right;margin-left: 0.75em; background: url(data:,%7B%20%22url%22%3A%20%22http%253A%252F%252Falbertech.net%252F2008%252F12%252Freset-mysql-auto-increment-to-1%252F%22%2C%20%22style%22%3A%20%22big%22%2C%20%22title%22%3A%20%22Reset%20MySQL%20auto%20increment%20to%201%22%20%7D);"></div>
<p>Here&#8217;s a quick reference to reset the MySQL auto_increment field to 1 and <strong>delete</strong> <strong>ALL rows in a table</strong>. This is useful in case you had to do some testing and wanted to reset the primary key field back to 1 and clear out the table.</p>
<p><code>truncate table [NAME OF TABLE]</code></p>
<p>If you don&#8217;t want to wipe out the table, you can reset the auto_increment by using:</p>
<p><code>alter table [NAME OF TABLE] auto_increment=1</code></p>

]]></content:encoded>
			<wfw:commentRss>http://albertech.net/2008/12/reset-mysql-auto-increment-to-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
