<?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>MySQL Preacher &#187; Beginner</title>
	<atom:link href="http://mysqlpreacher.com/wordpress/category/databases/mysql/beginner/feed/" rel="self" type="application/rss+xml" />
	<link>http://mysqlpreacher.com/wordpress</link>
	<description>A MySQL blog, from a MySQL DBA</description>
	<lastBuildDate>Wed, 16 Jun 2010 13:13:15 +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>MySQL anonymous accounts &#8211; User=&#8221;, Host=&#8217;%&#8217; &#8211; CODE RED</title>
		<link>http://mysqlpreacher.com/wordpress/2009/10/mysql-anonymous-accounts-user-host-code-red/</link>
		<comments>http://mysqlpreacher.com/wordpress/2009/10/mysql-anonymous-accounts-user-host-code-red/#comments</comments>
		<pubDate>Mon, 05 Oct 2009 13:50:30 +0000</pubDate>
		<dc:creator>Darren Cassar</dc:creator>
				<category><![CDATA[Beginner]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[%]]></category>
		<category><![CDATA[accounts]]></category>
		<category><![CDATA[anonymous]]></category>
		<category><![CDATA[authentication]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[threat]]></category>
		<category><![CDATA[usernames]]></category>

		<guid isPermaLink="false">http://mysqlpreacher.com/wordpress/?p=297</guid>
		<description><![CDATA[I want to highlight the importance of reviewing mysql&#8217;s initial set of accounts.
Say you have a mysql on abc.def.ghi.jkl running on port 3306 anonymous account with privileges without a password, then:
1. mysql (if issued on localhost)
2. mysql -h abc.def.ghi.jkl
3. mysql -u &#8221; -h abc.def.ghi.jkl
4. mysql -u &#8221; -h abc.def.ghi.jkl -P 3306
5. mysql -u user_which_does_not_exist -h [...]]]></description>
			<content:encoded><![CDATA[<p>I want to highlight the importance of reviewing mysql&#8217;s initial set of accounts.<br />
Say you have a mysql on abc.def.ghi.jkl running on port 3306 anonymous account with privileges without a password, then:<br />
1. mysql (if issued on localhost)<br />
2. mysql -h abc.def.ghi.jkl<br />
3. mysql -u &#8221; -h abc.def.ghi.jkl<br />
4. mysql -u &#8221; -h abc.def.ghi.jkl -P 3306<br />
5. mysql -u user_which_does_not_exist -h abc.def.ghi.jkl</p>
<p>will all manage to get into mysql given the way mysql authenticates users is against your username and client host from where you are connecting.</p>
<p>This verification is done versus the following columns in the mysql.user table, i.e., User,Host and Password columns.<br />
An entry in the mysql.user table with the following values User=&#8221;, Host=&#8217;%&#8217; will accept ANY user connecting from ANYWHERE in the world, thus disabling ANY security. Hence the reason for this blog post highlighting the importance of dropping such accounts, at least in all environments apart from dev.</p>
<p>Further information at:</p>
<p>http://dev.mysql.com/doc/refman/5.1/en/connection-access.html</p>
]]></content:encoded>
			<wfw:commentRss>http://mysqlpreacher.com/wordpress/2009/10/mysql-anonymous-accounts-user-host-code-red/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL related bookmark collection</title>
		<link>http://mysqlpreacher.com/wordpress/2009/09/mysql-related-bookmark-collection/</link>
		<comments>http://mysqlpreacher.com/wordpress/2009/09/mysql-related-bookmark-collection/#comments</comments>
		<pubDate>Thu, 17 Sep 2009 10:40:27 +0000</pubDate>
		<dc:creator>Darren Cassar</dc:creator>
				<category><![CDATA[Beginner]]></category>
		<category><![CDATA[Databases]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[administration]]></category>
		<category><![CDATA[benchmarking]]></category>
		<category><![CDATA[bookmarks]]></category>
		<category><![CDATA[cluster]]></category>
		<category><![CDATA[collection]]></category>
		<category><![CDATA[configuration]]></category>
		<category><![CDATA[general knowledge]]></category>
		<category><![CDATA[ha]]></category>
		<category><![CDATA[Information]]></category>
		<category><![CDATA[innodb]]></category>
		<category><![CDATA[monitoring]]></category>
		<category><![CDATA[performance analysis]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[slow queries]]></category>

		<guid isPermaLink="false">http://mysqlpreacher.com/wordpress/?p=293</guid>
		<description><![CDATA[I am publishing my MySQL related bookmark collection http://www.mysqlpreacher.com/bookmarks/.
Feel free to send me links you think might be good to add in order to help others.
Remember, SHARING IS CARING!!! …. we get so much for free, why shouldn’t we give some back?
Cheers,
Darren
]]></description>
			<content:encoded><![CDATA[<p>I am publishing my MySQL related bookmark collection <strong><a href="http://www.mysqlpreacher.com/bookmarks/" target="_blank">http://www.mysqlpreacher.com/bookmarks/</a></strong>.</p>
<p>Feel free to send me links you think might be good to add in order to help others.</p>
<p>Remember, SHARING IS CARING!!! …. we get so much for free, why shouldn’t we give some back?</p>
<p>Cheers,<br />
Darren</p>
]]></content:encoded>
			<wfw:commentRss>http://mysqlpreacher.com/wordpress/2009/09/mysql-related-bookmark-collection/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Securich &#8211; 0.1.4</title>
		<link>http://mysqlpreacher.com/wordpress/2009/08/securich-0-1-4/</link>
		<comments>http://mysqlpreacher.com/wordpress/2009/08/securich-0-1-4/#comments</comments>
		<pubDate>Mon, 10 Aug 2009 16:29:19 +0000</pubDate>
		<dc:creator>Darren Cassar</dc:creator>
				<category><![CDATA[Beginner]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[administration]]></category>
		<category><![CDATA[grant]]></category>
		<category><![CDATA[group]]></category>
		<category><![CDATA[groups]]></category>
		<category><![CDATA[password complexity]]></category>
		<category><![CDATA[password expiry]]></category>
		<category><![CDATA[revoke]]></category>
		<category><![CDATA[role]]></category>
		<category><![CDATA[roles]]></category>
		<category><![CDATA[securich]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[user]]></category>
		<category><![CDATA[users]]></category>

		<guid isPermaLink="false">http://mysqlpreacher.com/wordpress/?p=256</guid>
		<description><![CDATA[New Securich release - 0.1.4
   * Added Password complexity
   * Enhanced `set_password` - Old password is now necessary to replace it by a new one
   * Enhanced Revoke privileges to accept regexp
   * Added Block user@hostname on a database level
   * Added Creation of reserved usernames]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.securich.com">Just a small note to advise that Securich reached 0.1.4.</a><br />
Some new tools include:<br />
   * Added Password complexity<br />
   * Enhanced `set_password` &#8211; Old password is now necessary to replace it by a new one<br />
   * Enhanced Revoke privileges to accept regexp<br />
   * Added Block user@hostname on a database level<br />
   * Added Creation of reserved usernames<br />
   * Added Help stored procedure displays help for each stored proc<br />
   * Enhanced `create_update_role` to include the removal of privilages from roles<br />
   * Enhanced `grant_priveleges` on `alltables` for a database without tables would terminate with an error instead of gracefully (now fixed)<br />
   * Added Restore user@hostname on a database level<br />
   * Removed &#8217;show warnings&#8217; from sql installation</p>
<p>The database design using workbench is also available in the db folder (for easier understanding of what lies beneath.</p>
<p>Cheers,<br />
Darren</p>
]]></content:encoded>
			<wfw:commentRss>http://mysqlpreacher.com/wordpress/2009/08/securich-0-1-4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL processlist &#8211; (show/kill processes)</title>
		<link>http://mysqlpreacher.com/wordpress/2009/07/mysql-processlist-showkill-processes/</link>
		<comments>http://mysqlpreacher.com/wordpress/2009/07/mysql-processlist-showkill-processes/#comments</comments>
		<pubDate>Fri, 03 Jul 2009 10:55:41 +0000</pubDate>
		<dc:creator>Darren Cassar</dc:creator>
				<category><![CDATA[Beginner]]></category>
		<category><![CDATA[Databases]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[kill]]></category>
		<category><![CDATA[mysql stored procedure]]></category>
		<category><![CDATA[processes]]></category>
		<category><![CDATA[processlist]]></category>
		<category><![CDATA[sp]]></category>
		<category><![CDATA[stored proc]]></category>
		<category><![CDATA[stored procedure]]></category>

		<guid isPermaLink="false">http://mysqlpreacher.com/wordpress/?p=208</guid>
		<description><![CDATA[It"s not the most common task in the world, but you might want to view processes from a particular user and once in a while you might even need to kill processes from a single user, be it during an attack or because you simply got a bug in an application bombarding your db server with connections!]]></description>
			<content:encoded><![CDATA[<p>It&#8221;s not the most common task in the world, but you might want to view processes from a particular user and once in a while you might even need to kill processes from a single user, be it during an attack or because you simply got a bug in an application bombarding your db server with connections!</p>
<p>Here is a small stored procedure which does exactly that!</p>
<blockquote><p><code lang="sql">call process_list("show","username","hostname");</code><br />
&#8211; shows all processes owned by username@hostname<br />
<code lang="sql">call process_list("kill","username","hostname");</code><br />
&#8211; kills all processes owned by username@hostname</p></blockquote>
<p>The code for this stored procedure can be found below. If you have any comments / suggestions feel free to comment below.</p>
<blockquote><p><code lang="sql">######################################################################<br />
##                                                                  ##<br />
##  Stored Procedure: process_list &amp; kill user                  ##<br />
##  call process_list("show","%") show processlist for all users    ##<br />
##  call process_list("show","root") show processlist for root user ##<br />
##  call process_list("kill","user1") kill connections for user1    ##<br />
##                                                                  ##<br />
##  by Darren Cassar http://www.mysqlpreacher.com                   ##<br />
##                                                                  ##<br />
######################################################################</code></p>
<p><code lang="sql">DROP PROCEDURE IF EXISTS process_list;</code></p>
<p><code lang="sql">DELIMITER $$</code></p>
<p><code lang="sql">CREATE PROCEDURE "process_list"( choice char(4), usernamein varchar(16), hostnamein varchar(60))<br />
BEGIN</p>
<p>DECLARE CURCONN int;</p>
<p>IF choice &lt;&gt; "show" AND choice &lt;&gt; "kill" then<br />
select "wrong choice";<br />
END IF;</p>
<p>IF usernamein = "" then<br />
set usernamein = "%";<br />
END IF;</p>
<p>IF hostnamein = "" then<br />
set hostnamein = "%";<br />
END IF;</p>
<p>SET CURCONN=(select connection_id());</p>
<p>IF choice = "show" then</p>
<p>select *<br />
from information_schema.processlist<br />
where ID &lt;&gt; CURCONN and<br />
USER like usernamein and<br />
( HOST like CONCAT(hostnamein ,":%") or<br />
HOST like hostnamein );</p>
<p>ELSEIF choice = "kill" then</p>
<p>IF usernamein = "root" then<br />
select "Illegal username when killing processes";<br />
ELSE<br />
SET @CNT = (<br />
select count(*)<br />
from information_schema.processlist<br />
where ID &lt;&gt; CURCONN and<br />
USER like usernamein and<br />
( HOST like CONCAT(hostnamein ,":%") or<br />
HOST like hostnamein )<br />
);</p>
<p>SET @VAR=1;</p>
<p>WHILE ( @VAR &lt;= @CNT) DO</p>
<p>SET @TID = (<br />
select id<br />
from information_schema.processlist<br />
where ID &lt;&gt; CURCONN and<br />
USER like usernamein and<br />
( HOST like CONCAT(hostnamein ,":%") or<br />
HOST like hostnamein ) limit 1<br />
);</p>
<p>SET @k = CONCAT("kill " , @TID);<br />
PREPARE killcom FROM @k;<br />
EXECUTE killcom;<br />
set @k=NULL;</p>
<p>SET @VAR=@VAR+1;</p>
<p>END WHILE;</p>
<p>END IF;</p>
<p>END IF;</p>
<p>END$$</p>
<p></code><code lang="sql">DELIMITER ;<br />
</code></p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://mysqlpreacher.com/wordpress/2009/07/mysql-processlist-showkill-processes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Save time and energy: How to &#8230; (&#8230; continued)</title>
		<link>http://mysqlpreacher.com/wordpress/2009/07/save-time-and-energy-how-to-continued/</link>
		<comments>http://mysqlpreacher.com/wordpress/2009/07/save-time-and-energy-how-to-continued/#comments</comments>
		<pubDate>Thu, 02 Jul 2009 14:35:04 +0000</pubDate>
		<dc:creator>Darren Cassar</dc:creator>
				<category><![CDATA[Beginner]]></category>
		<category><![CDATA[Databases]]></category>
		<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://mysqlpreacher.com/wordpress/?p=203</guid>
		<description><![CDATA[Earlier this year I had published a small blog about being efficient when using mysql prompt. This is a small continuation of it highlighting a couple of other cool features which I really find very useful when working command line (i.e. always!).
The first I&#8217;m gonna list here is setting the prompt itself by typing &#8211; [...]]]></description>
			<content:encoded><![CDATA[<p>Earlier this year I had published a small blog about being efficient when using mysql prompt. This is a small continuation of it highlighting a couple of other cool features which I really find very useful when working command line (i.e. always!).</p>
<p>The first I&#8217;m gonna list here is setting the prompt itself by typing &#8211; <code lang="sql">\R mysql \D > </code>thus enabling date and time display at each comand which is great for auditing and record keeping. There is a whole bunch of prompt values which you can find <a href="http://dev.mysql.com/doc/refman/5.0/en/mysql-commands.html">here</a>:</p>
<blockquote><p>
<code lang="c">Option 	Description<br />
\c 	//A counter that increments for each statement you issue<br />
\D 	//The full current date<br />
\d 	//The default database<br />
\h 	//The server host<br />
\l 	//The current delimiter (new in 5.0.25)<br />
\m 	//Minutes of the current time<br />
\n 	//A newline character<br />
\O 	//The current month in three-letter format (Jan, Feb, …)<br />
\o 	//The current month in numeric format<br />
\P 	//am/pm<br />
\p 	//The current TCP/IP port or socket file<br />
\R 	//The current time, in 24-hour military time (0–23)<br />
\r 	//The current time, standard 12-hour time (1–12)<br />
\S 	//Semicolon<br />
\s 	//Seconds of the current time<br />
\t 	//A tab character<br />
\U 	//Your full user_name@host_name account name<br />
\u 	//Your user name<br />
\v 	//The server version<br />
\w 	//The current day of the week in three-letter format (Mon, Tue, …)<br />
\Y 	//The current year, four digits<br />
\y 	//The current year, two digits<br />
\_ 	//A space<br />
\  	//A space (a space follows the backslash)<br />
\' 	'//Single quote<br />
\" 	"//Double quote<br />
\\ 	//A literal “\” backslash character<br />
\x 	//x, for any “x” not listed above</code></p></blockquote>
<p>
The second thing is the \e or edit which lets you edit a long query you might have been writing, in any editor you have set on your machine, most often <em>vi</em>, a must know editor for all of you out there.</p>
<p>Enjoy<br />
Darren</p>
]]></content:encoded>
			<wfw:commentRss>http://mysqlpreacher.com/wordpress/2009/07/save-time-and-energy-how-to-continued/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MCDBA Certification &#8211; KPIs</title>
		<link>http://mysqlpreacher.com/wordpress/2009/03/mcdba-certification-kpis/</link>
		<comments>http://mysqlpreacher.com/wordpress/2009/03/mcdba-certification-kpis/#comments</comments>
		<pubDate>Fri, 27 Mar 2009 16:15:58 +0000</pubDate>
		<dc:creator>Darren Cassar</dc:creator>
				<category><![CDATA[Advanced]]></category>
		<category><![CDATA[Beginner]]></category>
		<category><![CDATA[Databases]]></category>
		<category><![CDATA[Intermediate]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[certification]]></category>
		<category><![CDATA[exam]]></category>
		<category><![CDATA[kpis]]></category>
		<category><![CDATA[MCDBA]]></category>
		<category><![CDATA[MySQL certified dba]]></category>
		<category><![CDATA[statistics]]></category>

		<guid isPermaLink="false">http://mysqlpreacher.com/wordpress/?p=128</guid>
		<description><![CDATA[A few interesting KPIs about certified people and their current location (the fact that many people travel from one country to the other for work is very popular these days especially in the IT sector):
Before starting to read, I am hereby assuming the MySQL list of MCDBAs is on a residence basis not citizenship.
There are [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: left;">A few interesting KPIs about certified people and their current location (the fact that many people travel from one country to the other for work is very popular these days especially in the IT sector):</p>
<p style="text-align: left;">Before starting to read, I am hereby assuming the MySQL list of MCDBAs is on a residence basis not citizenship.</p>
<p style="text-align: left;">There are at the time of this writing a total of 796 MCDBAs in the world, living in 57 countries.</p>
<p style="text-align: left;">When analyzing the number of MCDBAs / country, it is pretty obvious the scene is totally dominated by the US:</p>
<p style="text-align: left;"><a href="http://mysqlpreacher.com/wordpress/wp-content/uploads/2009/03/no_country1.jpg"><img class="size-full wp-image-138 aligncenter" title="MCDBA Certification KPIs / Country" src="http://mysqlpreacher.com/wordpress/wp-content/uploads/2009/03/no_country1.jpg" alt="" width="500" height="414" /></a></p>
<p><code>+----------------------+-------------+</code><br />
<code>| Country              | No of Certs |</code><br />
<code>+----------------------+-------------+</code><br />
<code>| UnitedStates         |         346 | </code><br />
<code>| Unitedkingdom        |          47 | </code><br />
<code>| Germany              |          46 | </code><br />
<code>| India                |          34 | <br />
| Italy                |          28 | <br />
| Japan                |          26 | <br />
| Canada               |          23 | <br />
| China                |          20 | <br />
| Brazil               |          18 | <br />
| Australia            |          16 | <br />
| France               |          16 | <br />
| Netherlands          |          13 | <br />
| Switzerland          |          13 | <br />
| SouthKorea           |          12 | <br />
| Spain                |          11 | <br />
| HongKong             |          10 | <br />
| Sweden               |          10 | <br />
| SouthAfrica          |          10 | <br />
| Singapore            |           9 | <br />
| Taiwan               |           8 | <br />
| Poland               |           7 | <br />
| Philippines          |           6 | <br />
| Norway               |           5 | <br />
| Russia               |           5 | <br />
| Finland              |           5 | <br />
| Ireland              |           4 | <br />
| Israel               |           3 | <br />
| Srilanka             |           3 | <br />
| Ukraine              |           3 | <br />
| Austria              |           3 | <br />
| Belgium              |           3 | <br />
| Denmark              |           2 | <br />
| Egypt                |           2 | <br />
| Mexico               |           2 | <br />
| Malta                |           2 | <br />
| Thailand             |           2 | <br />
| Unitedarabemirates   |           2 | <br />
| Latvia               |           2 | <br />
| Bangladesh           |           1 | <br />
| Croatia              |           1 | <br />
| TrinidadandTobago    |           1 | <br />
| BosniaandHerzegovina |           1 | <br />
| Malaysia             |           1 | <br />
| Slovenia             |           1 | <br />
| SaudiArabia          |           1 | <br />
| Indonesia            |           1 | <br />
| Jordan               |           1 | <br />
| Kenya                |           1 | <br />
| Lithuania            |           1 | <br />
| Luxembourg           |           1 | <br />
| Guatemala            |           1 | <br />
| Nepal                |           1 | <br />
| Gibraltar            |           1 | <br />
| Newzealand           |           1 | <br />
| Pakistan             |           1 | <br />
| Portugal             |           1 | <br />
| Virginislands        |           1 | <br />
<code>+----------------------+-------------+ <br />
</code></code></p>
<p><code> </code></p>
<p><code></p>
<p style="text-align: left;">But what happens when we look at the number of MCDBAS in respect to population / area?</p>
<p style="text-align: left;">The country with largest certs / capita is Gibralter with a MySQL Certified DBA in 31k population, followed by Virgin Islands at 1 for 110k and Malta at 2 / 412.6k.</p>
<p style="text-align: left;">The country with least certs / capita is Indonesia with a single MySQL Certified DBA out of almost 230M people.</p>
<p style="text-align: left;"><span style="text-decoration: underline;"><a href="http://mysqlpreacher.com/wordpress/wp-content/uploads/2009/03/no_population1.jpg"><img class="aligncenter size-full wp-image-139" title="MCDBA Certification KPIs / population" src="http://mysqlpreacher.com/wordpress/wp-content/uploads/2009/03/no_population1.jpg" alt="" width="500" height="607" /></a><br />
</span><br />
<code>+----------------------+------------+-------------+---------+</code><br />
<code>| Country              | Population | No of Certs | PPM     |</code><br />
<code>+----------------------+------------+-------------+---------+</code><br />
<code>| Gibraltar            |      31000 |           1 | 32.2580 | </code><br />
<code>| Virgin Islands       |     110000 |           1 |  9.0900 | </code><br />
<code>| Malta                |     412600 |           2 |  4.8470 | </code><br />
<code>| Luxembourg           |     491700 |           1 |  2.0330 | </code><br />
<code>| Singapore            |    4839400 |           9 |  1.8590 | <br />
| Switzerland          |    7700200 |          13 |  1.6880 | <br />
| Hong Kong            |    6985200 |          10 |  1.4310 | <br />
| United States        |  306088000 |         346 |  1.1300 | <br />
| Sweden               |    9259828 |          10 |  1.0790 | <br />
| Norway               |    4810122 |           5 |  1.0390 | <br />
| Finland              |    5331096 |           5 |  0.9370 | <br />
| Ireland              |    4517800 |           4 |  0.8850 | <br />
| Latvia               |    2260000 |           2 |  0.8840 | <br />
| Netherlands          |   16492476 |          13 |  0.7880 | <br />
| United Kingdom       |   61612300 |          47 |  0.7620 | <br />
| Trinidad and Tobago  |    1339000 |           1 |  0.7460 | <br />
| Australia            |   21707964 |          16 |  0.7370 | <br />
| Canada               |   33596000 |          23 |  0.6840 | <br />
| Germany              |   82062200 |          46 |  0.5600 | <br />
| Slovenia             |    2053355 |           1 |  0.4870 | <br />
| Italy                |   60090400 |          28 |  0.4650 | <br />
| United Arab Emirates |    4599000 |           2 |  0.4340 | <br />
| Israel               |    7382200 |           3 |  0.4060 | <br />
| Denmark              |    5511451 |           2 |  0.3620 | <br />
| Austria              |    8356700 |           3 |  0.3580 | <br />
| Taiwan               |   23027672 |           8 |  0.3470 | <br />
| Lithuania            |    3350400 |           1 |  0.2980 | <br />
| Belgium              |   10741000 |           3 |  0.2790 | <br />
| Bosnia Herzegovina   |    3767000 |           1 |  0.2650 | <br />
| South Korea          |   48333000 |          12 |  0.2480 | <br />
| France               |   65073482 |          16 |  0.2450 | <br />
| Spain                |   45853000 |          11 |  0.2390 | <br />
| New Zealand          |    4302010 |           1 |  0.2320 | <br />
| Croatia              |    4432000 |           1 |  0.2250 | <br />
| South Africa         |   48697000 |          10 |  0.2050 | <br />
| Japan                |  127630000 |          26 |  0.2030 | <br />
| Poland               |   38130300 |           7 |  0.1830 | <br />
| Jordan               |    6316000 |           1 |  0.1580 | <br />
| Sri Lanka            |   20238000 |           3 |  0.1480 | <br />
| Brazil               |  190902000 |          18 |  0.0940 | <br />
| Portugal             |   10631800 |           1 |  0.0940 | <br />
| Guatemala            |   14027000 |           1 |  0.0710 | <br />
| Philippines          |   92226600 |           6 |  0.0650 | <br />
| Ukraine              |   46143700 |           3 |  0.0650 | <br />
| Saudi Arabia         |   25721000 |           1 |  0.0380 | <br />
| Russia               |  141850000 |           5 |  0.0350 | <br />
| Malaysia             |   28067000 |           1 |  0.0350 | <br />
| Nepal                |   29331000 |           1 |  0.0340 | <br />
| Thailand             |   63389730 |           2 |  0.0310 | <br />
| India                | 1161120000 |          34 |  0.0290 | <br />
| Egypt                |   76030000 |           2 |  0.0260 | <br />
| Kenya                |   39802000 |           1 |  0.0250 | <br />
| Mexico               |  109610000 |           2 |  0.0180 | <br />
| China                | 1335962133 |          20 |  0.0140 | <br />
| Bangladesh           |  162221000 |           1 |  0.0060 | <br />
| Pakistan             |  165899500 |           1 |  0.0060 | <br />
| Indonesia            |  229850000 |           1 |  0.0040 | <br />
+----------------------+------------+-------------+---------+<br />
</code></p>
<p style="text-align: left;">On a per area basis, the country with most certified MySQL DBAs is again Gibralter given its 6Km squared of area, followed by Singapore, Hong Kong and Malta.</p>
<p style="text-align: left;">The least being Pakistan, Russia and Indonesia in order.</p>
<p style="text-align: left;"><a href="http://mysqlpreacher.com/wordpress/wp-content/uploads/2009/03/no_km1.jpg"><img class="aligncenter size-full wp-image-140" title="MCDBA Certification KPIs / 1000 Km squared" src="http://mysqlpreacher.com/wordpress/wp-content/uploads/2009/03/no_km1.jpg" alt="" width="500" height="541" /></a></p>
<p style="text-align: left;">*PPK here means parts per 1000 Km squared</p>
<p><code>+----------------------+----------+-------------+----------+</code><br />
<code>| Country              | Area     | No of Certs | PPK*     |</code><br />
<code>+----------------------+----------+-------------+----------+</code><br />
<code>| Gibraltar            |        6 |           1 | 166.6667 | </code><br />
<code>| Singapore            |      699 |           9 |  12.8755 | </code><br />
<code>| Hong Kong            |     1108 |          10 |   9.0253 | </code><br />
<code>| Malta                |      316 |           2 |   6.3291 | </code><br />
<code>| Virgin Islands       |      347 |           1 |   2.8818 | <br />
| Luxembourg           |     2586 |           1 |   0.3867 | <br />
| Switzerland          |    41284 |          13 |   0.3149 | <br />
| Netherlands          |    41543 |          13 |   0.3129 | <br />
| Taiwan               |    36188 |           8 |   0.2211 | <br />
| Trinidad and Tobago  |     5130 |           1 |   0.1949 | <br />
| United Kingdom       |   242900 |          47 |   0.1935 | <br />
| Israel               |    22072 |           3 |   0.1359 | <br />
| Germany              |   357022 |          46 |   0.1288 | <br />
| South Korea          |    99678 |          12 |   0.1204 | <br />
| Belgium              |    30528 |           3 |   0.0983 | <br />
| Italy                |   301318 |          28 |   0.0929 | <br />
| Japan                |   377915 |          26 |   0.0688 | <br />
| Ireland              |    70273 |           4 |   0.0569 | <br />
| Slovenia             |    20273 |           1 |   0.0493 | <br />
| Denmark              |    43094 |           2 |   0.0464 | <br />
| Sri Lanka            |    65610 |           3 |   0.0457 | <br />
| United States        |  9629091 |         346 |   0.0359 | <br />
| Austria              |    83871 |           3 |   0.0358 | <br />
| Latvia               |    64589 |           2 |   0.0310 | <br />
| France               |   632760 |          16 |   0.0253 | <br />
| United Arab Emirates |    83600 |           2 |   0.0239 | <br />
| Poland               |   312685 |           7 |   0.0224 | <br />
| Sweden               |   450295 |          10 |   0.0222 | <br />
| Spain                |   505992 |          11 |   0.0217 | <br />
| Philippines          |   300000 |           6 |   0.0200 | <br />
| Bosnia Herzegovina   |    51197 |           1 |   0.0195 | <br />
| Croatia              |    56594 |           1 |   0.0177 | <br />
| Norway               |   323802 |           5 |   0.0154 | <br />
| Lithuania            |    65300 |           1 |   0.0153 | <br />
| Finland              |   338145 |           5 |   0.0148 | <br />
| Jordan               |    89342 |           1 |   0.0112 | <br />
| Portugal             |    92090 |           1 |   0.0109 | <br />
| India                |  3287263 |          34 |   0.0103 | <br />
| Guatemala            |   108889 |           1 |   0.0092 | <br />
| South Africa         |  1221037 |          10 |   0.0082 | <br />
| Bangladesh           |   143998 |           1 |   0.0069 | <br />
| Nepal                |   147181 |           1 |   0.0068 | <br />
| Ukraine              |   603500 |           3 |   0.0050 | <br />
| Thailand             |   513120 |           2 |   0.0039 | <br />
| New Zealand          |   270467 |           1 |   0.0037 | <br />
| Malaysia             |   329847 |           1 |   0.0030 | <br />
| Canada               |  9984670 |          23 |   0.0023 | <br />
| Brazil               |  8514877 |          18 |   0.0021 | <br />
| Australia            |  7692024 |          16 |   0.0021 | <br />
| China                |  9640821 |          20 |   0.0021 | <br />
| Egypt                |  1002000 |           2 |   0.0020 | <br />
| Kenya                |   580367 |           1 |   0.0017 | <br />
| Mexico               |  1964375 |           2 |   0.0010 | <br />
| Saudi Arabia         |  2000000 |           1 |   0.0005 | <br />
| Indonesia            |  1904569 |           1 |   0.0005 | <br />
| Russia               | 17098242 |           5 |   0.0003 | <br />
| Pakistan             |  7960951 |           1 |   0.0001 | <br />
+----------------------+----------+-------------+----------+<br />
</code></p>
<p style="text-align: left;">At this point I'd like to ask the community a couple of questions:</p>
<p style="text-align: left;">1. Do you think there are many good MySQL DBAs who never tried getting certified?</p>
<p style="text-align: left;">2. Would you think it is fair to assume, the people who never tried the MCDBA exam is proportional to does who did? (my guess is yes)</p>
<p style="text-align: left;"> <br />
KPIs for developers and cluster certified people will follow in other blogs.</p>
<p></code></p>
]]></content:encoded>
			<wfw:commentRss>http://mysqlpreacher.com/wordpress/2009/03/mcdba-certification-kpis/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Save time and energy: How to &#8230;</title>
		<link>http://mysqlpreacher.com/wordpress/2009/02/save-time-and-energy-how-to/</link>
		<comments>http://mysqlpreacher.com/wordpress/2009/02/save-time-and-energy-how-to/#comments</comments>
		<pubDate>Mon, 23 Feb 2009 11:58:48 +0000</pubDate>
		<dc:creator>Darren Cassar</dc:creator>
				<category><![CDATA[Beginner]]></category>
		<category><![CDATA[Databases]]></category>
		<category><![CDATA[Intermediate]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[auto completion]]></category>
		<category><![CDATA[cli]]></category>
		<category><![CDATA[rehash]]></category>

		<guid isPermaLink="false">http://mysqlpreacher.com/wordpress/?p=91</guid>
		<description><![CDATA[Save time and energy: How to:
Listening to &#8220;Highway to Hell&#8221; in an Oxford University computer lab on a sunday afternoon writing a MySQL blog can be legitimally defined by some as sick but thats what a geek calls a relaxing yet productive sunday afternoon.
For the sake of all those CLI ambassadors like myself, I wanted [...]]]></description>
			<content:encoded><![CDATA[<p>Save time and energy: How to:</p>
<p>Listening to &#8220;Highway to Hell&#8221; in an Oxford University computer lab on a sunday afternoon writing a MySQL blog can be legitimally defined by some as sick but thats what a geek calls a relaxing yet productive sunday afternoon.</p>
<p>For the sake of all those CLI ambassadors like myself, I wanted to share a couple of tips and tricks I use quite often when doing my mysql db administration work / scripting. I strongly suggest any mysql dba / dev use CLI simply because thats the one thing you should always have on any machine on which mysql is installed, be it Unix, Linux, Mac, Microsoft or whatever platform you are using.</p>
<p>Cancelling a query you are typing without exiting to the terminal:<br />
`\c` &#8211; How many times you ended up hitting `CTRL+C` (default process kill in most OSes) in order to cancel a command, finding yourself going back to the console and having to connect again? Nuisence? Hell yeah! Especially if you had a number of temp tables waiting to be used.</p>
<p><code><br />
A `CTRL+C` would bring send you to console:<br />
mysql&gt; SELECT<br />
-&gt; User, Host<br />
-&gt; OOPS I DID A MISTAKE<br />
-&gt; FROM           --Hit `CTRL+C` here<br />
-&gt; Aborted<br />
mysqlpreacher:~ darrencassar$</p>
<p>A `\c` in the mysql program would just cancel the wrong query:<br />
mysql&gt; SELECT<br />
-&gt; User, Host<br />
-&gt; OOPS I DID A MISTAKE<br />
-&gt; FROM<br />
-&gt; \c<br />
mysql&gt;<br />
</code><br />
BTW it doesn&#8217;t work with the USE command &#8211; it gives an error but at least doesn&#8217;t terminate the connection:<br />
<code><br />
mysql&gt; USE m\c<br />
ERROR 1049 (42000): Unknown database 'mc'<br />
mysql&gt;<br />
</code></p>
<p>Running a console command from within a mysql terminal session:<br />
`\!` &#8211; Need to run a console command while you are logged in a mysql terminal session? There is no need to exit the current session or to dupplicate the terminal session and run the command, just use `\!`</p>
<p><code><br />
mysql&gt; \! pwd<br />
/var/root/sandboxes/mysql_5130<br />
mysql&gt; \! ls<br />
COPYING			VERSION			data			my			restart			stop<br />
README			clear			grants.mysql		my.sandbox.cnf		send_kill		use<br />
USING			current_options.conf	load_grants		proxy_start		start<br />
mysql&gt; \! ps -ef | grep mysql | grep -v grep<br />
0 36319     1   0   0:00.01 ttys002    0:00.02 /bin/sh /mysql/releases/5.1/5.1.30/bin/mysqld_safe --defaults-file=/var/root/sandboxes/mysql_5130/my.sandbox.cnf<br />
0 36389 36319   0   0:00.14 ttys002    0:01.48 /mysql/releases/5.1/5.1.30/bin/mysqld --defaults-file=/var/root/sandboxes/mysql_5130/my.sandbox.cnf --basedir=/mysql/releases/5.1/5.1.30 --datadir=/var/root/sandboxes/mysql_5130/data --user=root --log-error=/var/root/sandboxes/mysql_5130/data/msandbox.err --pid-file=/var/root/sandboxes/mysql_5130/data/mysql_sandbox3308.pid --socket=/tmp/mysql_sandbox3308.sock --port=3308<br />
0 36987 26344   0   0:00.01 ttys002    0:00.02 mysql -u root -p --auto-rehash -h 127.0.0.1 -P 3308<br />
0 36992 36987   0   0:00.00 ttys002    0:00.00 sh -c  ps -ef | grep mysql<br />
mysql&gt;<br />
</code></p>
<p>Autocompletion on command line mysql:<br />
`\#`, `rehash` or `&#8211;auto-rehash` &#8211; Autocompletion is fast, handy and help you produce more in less.<br />
Autocompletion in MySQL is enabled by default, and there is a need to use &#8211;disable-auto-rehash  (note that &#8211;no-auto-rehash or -A are deprecated) in order to disable rehashing which makes mysql start faster. If this is done, then it can be called upon using either of the following `\#`, `rehash` or using `&#8211;autu-rehash` depending on where you are and what you are comfortable with. If you are already in a mysql terminal session, then type in `\#` or `rehash`. Another option is to connect to mysql using: `mysql -u user -p &#8211;auto-rehash` as a startup option. Having done that, remember to initialise the hashing by issueing a `USE DATABASENAME` as otherwise the autocompletion won&#8217;t work. Autocompleting a word / name can be done in a similar way to what you&#8217;d do in CL UNIX, LINUX or DOS, typing the first part of the word and then pressing `TAB`.</p>
<p>&#8211;auto-rehash:<br />
<code><br />
mysqlpreacher:~ darrencassar$ mysql -u root -p --auto-rehash -h 127.0.0.1 -P 3308<br />
Enter password:<br />
Welcome to the MySQL monitor.  Commands end with ; or \g.<br />
Your MySQL connection id is 5<br />
Server version: 5.1.30 MySQL Community Server (GPL)</p>
<p>Type 'help;' or '\h' for help. Type '\c' to clear the buffer.</p>
<p>mysql&gt; use mysql;<br />
Reading table information for completion of table and column names<br />
You can turn off this feature to get a quicker startup with -A</p>
<p>Database changed<br />
mysql&gt; use m<br />
max_connections       max_questions         max_updates           max_user_connections  modified              mysql<br />
mysql&gt; use mysql<br />
Database changed<br />
</code></p>
<p>\# or rehash:<br />
<code><br />
mysqlpreacher:~ darrencassar$ mysql -u root -p -h 127.0.0.1 -P 3308<br />
Enter password:<br />
Welcome to the MySQL monitor.  Commands end with ; or \g.<br />
Your MySQL connection id is 9<br />
Server version: 5.1.30 MySQL Community Server (GPL)</p>
<p>Type 'help;' or '\h' for help. Type '\c' to clear the buffer.</p>
<p>mysql&gt; \#<br />
mysql&gt; use mysql<br />
Reading table information for completion of table and column names<br />
You can turn off this feature to get a quicker startup with -A</p>
<p>Database changed<br />
mysql&gt; use m<br />
max_connections       max_questions         max_updates           max_user_connections  modified              mysql<br />
mysql&gt; use mysql<br />
</code></p>
<p>more tips and tricks will follow in future blogs,</p>
<p>Asta la vista mysql user!</p>
]]></content:encoded>
			<wfw:commentRss>http://mysqlpreacher.com/wordpress/2009/02/save-time-and-energy-how-to/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Slap&#8217;em</title>
		<link>http://mysqlpreacher.com/wordpress/2009/02/slapem/</link>
		<comments>http://mysqlpreacher.com/wordpress/2009/02/slapem/#comments</comments>
		<pubDate>Fri, 13 Feb 2009 13:37:49 +0000</pubDate>
		<dc:creator>Darren Cassar</dc:creator>
				<category><![CDATA[Beginner]]></category>
		<category><![CDATA[Databases]]></category>
		<category><![CDATA[Intermediate]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[benchmarking]]></category>
		<category><![CDATA[monitoring]]></category>
		<category><![CDATA[mysqlslap]]></category>
		<category><![CDATA[testing]]></category>

		<guid isPermaLink="false">http://mysqlpreacher.com/wordpress/?p=80</guid>
		<description><![CDATA[Giving a bunch of mysql instances something you do everyday and you might think &#8230;.. how should I do it? Write a bunch of selects and inserts manually? nahh that takes s**tload of time, should I run binlogs collected from a live system on my test server? nahh thats not practical nor is it real [...]]]></description>
			<content:encoded><![CDATA[<p>Giving a bunch of mysql instances something you do everyday and you might think &#8230;.. how should I do it? Write a bunch of selects and inserts manually? nahh that takes s**tload of time, should I run binlogs collected from a live system on my test server? nahh thats not practical nor is it real since it doesn&#8217;t contain selects, should I gather the general query log and try that out? nahhh  &#8230;..</p>
<p>MySQL has been kind enough to supply us with their mysql_slap which does the job for us and given I needed to do a proof of concept on monitoring a group of 4 circular replicated servers I wrote a small script which does the job of slapping them with a varying level of concurrancy, iterations, number of queries and connections for as long as you like.</p>
<p>Here it is and I hope some of you might find it useful for slapping their own test servers :).</p>
<blockquote><p><code>#!/bin/bash</code></p>
<p><code>NumberOfConcurrentLoads=4</code><br />
<code>LOGFILE=randomslap-4n-circularreplication</code></p>
<p><code>load () {</code></p>
<p><code> run=0</code><br />
<code> #Obtaining pid of the current process</code><br />
<code> PID=$$</code></p>
<p><code> echo "MySQL Slap random loading MySQL instances" &gt;&gt; $LOGFILE-$PID.log</code><br />
<code> echo "Loading child $a out of $NumberOfConcurrentLoads"  &gt;&gt; $LOGFILE-$PID.log</code><br />
<code> echo "Starting at: `date`" &gt;&gt; $LOGFILE-$PID.log</code><br />
<code> echo ""</code></p>
<p><code> while [ 1 ]</code><br />
<code> do</code></p>
<p><code> #Generate a few values for the actual command to run through</code><br />
<code> prt=$((RANDOM%4+17001))  #ports being 17001,17002,17003,17004</code><br />
<code> cnc=$((RANDOM%50+1))     #number of concurrent sessions</code><br />
<code> itr=$((RANDOM%9+1))      #number of iterations</code><br />
<code> noq=$((RANDOM%100+50))   #number of queries</code><br />
<code> sec=$((RANDOM%30+10))    #seconds idle after finishing the process</code></p>
<p><code> echo "Run number $run" &gt;&gt; $LOGFILE-$PID.log</code><br />
<code> echo `date +%Y/%m/%d---%H:%M | sed 's/---/  /'` &gt;&gt; $LOGFILE-$PID.log</code></p>
<p><code> echo "Port=$prt" &gt;&gt; $LOGFILE-$PID.log</code><br />
<code> echo "Concurrency=$cnc" &gt;&gt; $LOGFILE-$PID.log</code><br />
<code> echo "Iterations=$itr" &gt;&gt; $LOGFILE-$PID.log</code><br />
<code> echo "Number-Of-Queries=$noq" &gt;&gt; $LOGFILE-$PID.log</code><br />
<code> echo "Breaktime=$sec" &gt;&gt; $LOGFILE-$PID.log</code></p>
<p><code> echo "Output:" &gt;&gt; $LOGFILE-$PID.log</code><br />
<code> mysqlslap --user=root --password='msandbox' --auto-generate-sql -vv -h hostname -P $prt --concurrency=$cnc --iterations=$itr --number-of-queries=$noq &gt;&gt; $LOGFILE-$PID.log</code></p>
<p><code> run=`expr $run + 1`</code><br />
<code> sleep $sec</code></p>
<p><code> done</code></p>
<p><code>}</code><br />
<code>#Fork a number of concurrent scripts to emulate more of a realistic load rather than one process connecting to just one server at a time</code><br />
<code>for ((a=1;a&lt;=NumberOfConcurrentLoads;a++))</code><br />
<code>do</code><br />
<code> load &amp;</code><br />
<code>done</code></p></blockquote>
<p>If you are wondering &#8230; yes I totally indendate my code :) but the html version came out this way and I didn&#8217;t bother with indenting it using html really.</p>
]]></content:encoded>
			<wfw:commentRss>http://mysqlpreacher.com/wordpress/2009/02/slapem/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
