<?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>Guides and Reviews for WordPress, PHP, MySQL, Apache, CMS Systems, jQuery, and other Technologies</description>
	<lastBuildDate>Tue, 31 Jan 2012 17:31:44 +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>Upgrading Debian Lenny to Squeeze with MySQL for row-based-replication</title>
		<link>http://albertech.net/2011/10/upgrading-debian-lenny-to-squeeze-with-mysql-for-row-based-replication/</link>
		<comments>http://albertech.net/2011/10/upgrading-debian-lenny-to-squeeze-with-mysql-for-row-based-replication/#comments</comments>
		<pubDate>Fri, 28 Oct 2011 22:46:56 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[debian]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[mysql 5.1]]></category>
		<category><![CDATA[row replication]]></category>
		<category><![CDATA[squeeze]]></category>
		<category><![CDATA[upgrade]]></category>

		<guid isPermaLink="false">http://albertech.net/?p=820</guid>
		<description><![CDATA[<img src="http://albertech.net/wp-content/uploads/2011/01/debian.jpg"><br />

I completed an upgrade of Debian Lenny to Squeeze on a production database server over the weekend. It went quite well and I had zero downtime thanks to my secondary database servers running in-place. One of the biggest benefits to running Squeeze is that MySQL runs at version 5.1.49. Lenny only supports up to MySQL 5.0.

Row-based-replication is safer to replicate data to other servers since all changes are replicated. Prior to MySQL 5.1.14, updates to the mySQL database were not replicated. They were updated via statements (e.g. GRANT, REVOKE). This can potentially cause data-consistency between the master and ... ]]></description>
		<wfw:commentRss>http://albertech.net/2011/10/upgrading-debian-lenny-to-squeeze-with-mysql-for-row-based-replication/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>MySQL Stats: Find number of rows in a database</title>
		<link>http://albertech.net/2011/01/mysql-stats-find-number-of-rows-in-a-database/</link>
		<comments>http://albertech.net/2011/01/mysql-stats-find-number-of-rows-in-a-database/#comments</comments>
		<pubDate>Tue, 11 Jan 2011 00:48:52 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[reports]]></category>
		<category><![CDATA[stats]]></category>

		<guid isPermaLink="false">http://albertech.net/?p=558</guid>
		<description><![CDATA[<strong>If you ever have the need to find the answer to the following:</strong>
<ul>
	<li>What are the number of tables in a MySQL database?</li>
	<li>What are the number of rows in a MySQL database?</li>
	<li>How much space is the MySQL database using up on the server?</li>
	<li>How many tables there are in a MySQL server?</li>
	<li>How many rows there are in a MySQL server?</li>
</ul>
<strong>One of the quickest ways to find out MySQL reporting stats is using </strong><a href="http://www.phpmyadmin.net" target="_blank"><strong>PHPMyAdmin</strong></a>. The software is usually installed on a number of servers by default, so its just a matter of locating where in the program to find this info.

This is an example of what the stats look ... ]]></description>
		<wfw:commentRss>http://albertech.net/2011/01/mysql-stats-find-number-of-rows-in-a-database/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<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[debian]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[MySQL]]></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>
		<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>
		<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>
		<wfw:commentRss>http://albertech.net/2010/03/mysql-case-insensitive-order-by/feed/</wfw:commentRss>
		<slash:comments>5</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>
		<wfw:commentRss>http://albertech.net/2010/01/mysql-tutorial-fetch-last-10-rows-without-reversing-order/feed/</wfw:commentRss>
		<slash:comments>2</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>
		<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>
		<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>
		<wfw:commentRss>http://albertech.net/2009/03/wordpress-mu-27-review/feed/</wfw:commentRss>
		<slash:comments>7</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>
		<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>
		<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>
		<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>
		<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>
		<wfw:commentRss>http://albertech.net/2008/12/reset-mysql-auto-increment-to-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

