<?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; MySQL</title>
	<atom:link href="http://mysqlpreacher.com/wordpress/category/databases/mysql/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 jdbc connector autoReconnect=true</title>
		<link>http://mysqlpreacher.com/wordpress/2010/06/mysql-jdbc-connector-autoreconnecttrue/</link>
		<comments>http://mysqlpreacher.com/wordpress/2010/06/mysql-jdbc-connector-autoreconnecttrue/#comments</comments>
		<pubDate>Wed, 16 Jun 2010 13:13:15 +0000</pubDate>
		<dc:creator>Darren Cassar</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[autoreconnect]]></category>
		<category><![CDATA[connector]]></category>
		<category><![CDATA[ibatis]]></category>
		<category><![CDATA[jdbc]]></category>
		<category><![CDATA[keepalive]]></category>
		<category><![CDATA[network]]></category>
		<category><![CDATA[ping]]></category>
		<category><![CDATA[wait_timeout]]></category>

		<guid isPermaLink="false">http://mysqlpreacher.com/wordpress/?p=356</guid>
		<description><![CDATA[What makes you think jdbc autoreconnect is needed?
Application is idle for long periods at a time?
Wait_timeout too short?
Network failure or glitches?
Some good suggestions form Mark Matthews - Bug #5020
Having encountered the problem again myself today, trying to make jdbc for mysql reconnect any terminated connections using autoreconnect=true I figured out a way to work it [...]]]></description>
			<content:encoded><![CDATA[<p>What makes you think jdbc autoreconnect is needed?<br />
Application is idle for long periods at a time?<br />
Wait_timeout too short?<br />
Network failure or glitches?</p>
<p>Some good suggestions form Mark Matthews -<a href="http://bugs.mysql.com/bug.php?id=5020" target="_blank"> Bug #5020</a></p>
<p>Having encountered the problem again myself today, trying to make jdbc for mysql reconnect any terminated connections using autoreconnect=true I figured out a way to work it out from the pooling side.<br />
<br />
Introduction to the problem:</p>
<p>On the mysql side wait_timeout is set to default 8hrs and any connections idle for longer than that were beomg terminated despite setting the connection string to: url=jdbc:mysql://localhost:3306/dbname?autoReconnect=true. The application was thence throwing an exception.</p>
<p>The solution was to introduce a ping from the pooler which for &#8220;Ibatis&#8221;, the pooler technology used in this case, was:</p>
<p>This covers eventualities of network glitches or connections exceeding the wait_timeout having the pooler ping the database if the connection was idle for more than 10 seconds (the value is in milliseconds).</p>
<p>The configuration if Ibatis in this case is something like:</p>
<p>Ibatis<code><br />
</code></p>
<p><code></p>
<div id="_mcePaste">&lt;transactionManager type="JDBC"&gt;</div>
<div id="_mcePaste">&lt;dataSource type="SIMPLE"&gt;</div>
<div id="_mcePaste">&lt;property value="${driver}" name="JDBC.Driver"/&gt;</div>
<div id="_mcePaste">&lt;property value="${url}" name="JDBC.ConnectionURL"/&gt;</div>
<div id="_mcePaste">&lt;property value="${username}" name="JDBC.Username"/&gt;</div>
<div id="_mcePaste">&lt;property value="${password}" name="JDBC.Password"/&gt;</div>
<div id="_mcePaste">&lt;property name="Pool.PingQuery" value="select 1"/&gt;</div>
<div id="_mcePaste">&lt;property name="Pool.PingEnabled" value="true"/&gt;</div>
<div id="_mcePaste">&lt;property name="Pool.PingConnectionsOlderThan" value="3600000"/&gt; &lt;!-- 1 hr --&gt;</div>
<div id="_mcePaste">&lt;property name="Pool.PingConnectionsNotUsedFor" value="10000"/&gt; &lt;!-- ping db 10 sec --&gt;</div>
<div id="_mcePaste">&lt;/dataSource&gt;</div>
<div id="_mcePaste">&lt;/transactionManager&gt;</div>
<div></div>
<p></code></p>
<p>For every pooling technology there will be a different &#8220;Pool.PingConnectionsNotUsedFor&#8221; term, but the concept is still there. It worked like a charm.</p>
<p><code><br />
JDBC driver=com.mysql.jdbc.Driver<br />
url=jdbc:mysql://localhost:3306/dbname<br />
username=username<br />
password=password</code></p>
<p>PS &#8230; autoreconnect is not recommended when using mysql jdbc!</p>
]]></content:encoded>
			<wfw:commentRss>http://mysqlpreacher.com/wordpress/2010/06/mysql-jdbc-connector-autoreconnecttrue/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Datetime &amp; Timestamp manipulation / migration explained</title>
		<link>http://mysqlpreacher.com/wordpress/2010/06/datetime-timestamp-manipulation-migration-explained/</link>
		<comments>http://mysqlpreacher.com/wordpress/2010/06/datetime-timestamp-manipulation-migration-explained/#comments</comments>
		<pubDate>Tue, 15 Jun 2010 16:47:16 +0000</pubDate>
		<dc:creator>Darren Cassar</dc:creator>
				<category><![CDATA[Advanced]]></category>
		<category><![CDATA[Intermediate]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[datetime]]></category>
		<category><![CDATA[date_format]]></category>
		<category><![CDATA[microsecond]]></category>
		<category><![CDATA[migrating to mysql]]></category>
		<category><![CDATA[migration]]></category>
		<category><![CDATA[millisecond]]></category>
		<category><![CDATA[mysql millisecond]]></category>
		<category><![CDATA[str_to_date]]></category>
		<category><![CDATA[timstamp]]></category>

		<guid isPermaLink="false">http://mysqlpreacher.com/wordpress/?p=351</guid>
		<description><![CDATA[Are you doing some datetime manipulation or maybe you are migrating from some database technology to MySQL or possibly using milliseconds?
Here is an example on how to go about it:
Say you have the following date: MAR 16 2008 09:12:51:893AM
SELECT DATE_FORMAT(STR_TO_DATE('MAR 16 2008 09:12:51:893AM','%M %d %Y %h:%i:%s:%f%p'),'%Y%m%d%k%i%s.%f'); --&#62; 2008031691251.893000

What if its PM rather than AM
SELECT DATE_FORMAT(STR_TO_DATE('MAR [...]]]></description>
			<content:encoded><![CDATA[<p>Are you doing some datetime manipulation or maybe you are migrating from some database technology to MySQL or possibly using milliseconds?<br />
Here is an example on how to go about it:</p>
<p>Say you have the following date: MAR 16 2008 09:12:51:893AM<br />
<code>SELECT DATE_FORMAT(STR_TO_DATE('MAR 16 2008 09:12:51:893AM','%M %d %Y %h:%i:%s:%f%p'),'%Y%m%d%k%i%s.%f'); --&gt; 2008031691251.893000<br />
</code></p>
<p>What if its PM rather than AM<br />
<code>SELECT DATE_FORMAT(STR_TO_DATE('MAR 16 2008 09:12:51:893PM','%M %d %Y %h:%i:%s:%f%p'),'%Y%m%d%k%i%s.%f'); --&gt; 20080316211251.893000<br />
</code></p>
<p>Ok so this is just simple string manipulation where:<br />
<code>%M is the month name<br />
%d is day number<br />
%Y is the year<br />
%h is the hour<br />
%i is the minute<br />
%s is the second<br />
%f is the microsecond<br />
%p is the period: ante or post meridiem</code><br />
In the DATE_FORMAT part we se a %k which is in 24hr format in order to loose the period.</p>
<p>A more detailed list is found <a href="http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html#function_date-format" target="_blank">here</a></p>
<p>Here is a demo:</p>
<p><code>mysql Tue Jun 15 12:32:37 2010 &gt; CREATE TABLE test.abc(a DECIMAL(17,3)) ENGINE=MYISAM;<br />
Query OK, 0 rows affected (0.03 sec)</code></p>
<p><code>mysql Tue Jun 15 12:32:45 2010 &gt; INSERT INTO abc VALUES ( DATE_FORMAT(STR_TO_DATE('MAR 16 2008 09:12:51:893PM','%M %d %Y %h:%i:%s:%f%p'),'%Y%m%d%k%i%s.%f') );<br />
Query OK, 1 row affected (0.01 sec)</code></p>
<p><code>mysql Tue Jun 15 12:32:51 2010 &gt; SELECT * FROM abc;<br />
+--------------------+<br />
| a                  |<br />
+--------------------+<br />
| 20080316211251.893 |<br />
+--------------------+<br />
1 row in set (0.00 sec)</p>
<p></code></p>
<p><code>mysql Tue Jun 15 12:32:56 2010 &gt; SELECT TIMESTAMP(a) FROM abc;<br />
+----------------------------+<br />
| TIMESTAMP(a)               |<br />
+----------------------------+<br />
| 2008-03-16 21:12:51.893000 |<br />
+----------------------------+<br />
1 row in set (0.00 sec)</code></p>
]]></content:encoded>
			<wfw:commentRss>http://mysqlpreacher.com/wordpress/2010/06/datetime-timestamp-manipulation-migration-explained/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Show warnings with MANY MANY warnings</title>
		<link>http://mysqlpreacher.com/wordpress/2010/06/show-warnings-with-many-many-warnings/</link>
		<comments>http://mysqlpreacher.com/wordpress/2010/06/show-warnings-with-many-many-warnings/#comments</comments>
		<pubDate>Mon, 14 Jun 2010 13:59:52 +0000</pubDate>
		<dc:creator>Darren Cassar</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[max_error_count]]></category>
		<category><![CDATA[pager]]></category>
		<category><![CDATA[pager more]]></category>
		<category><![CDATA[show warnings]]></category>
		<category><![CDATA[warning]]></category>

		<guid isPermaLink="false">http://mysqlpreacher.com/wordpress/?p=342</guid>
		<description><![CDATA[What to do when you have too many warnings and would like to check them out.
Say you were trying to run a query which returned a heap of warnings and you want to go through the list &#8230;.
mysql&#62;  load data infile '/aaa/bbb/ccc' into table xyz LINES TERMINATED BY '\r\n';
Query OK, 0 rows affected, 65535 [...]]]></description>
			<content:encoded><![CDATA[<p>What to do when you have too many warnings and would like to check them out.</p>
<p>Say you were trying to run a query which returned a heap of warnings and you want to go through the list &#8230;.</p>
<p><code>mysql&gt;  load data infile '/aaa/bbb/ccc' into table xyz LINES TERMINATED BY '\r\n';<br />
Query OK, 0 rows affected, 65535 warnings (4 min 25.12 sec)</code></p>
<p><code> </code></p>
<p><code>mysql&gt; show warnings;<br />
+---------+------+------------------------------------------------+<br />
| Level   | Code | Message                                        |<br />
+---------+------+------------------------------------------------+<br />
| Warning | 1366 | Incorrect value: '' for column 'xx' at row 1   |<br />
...<br />
| Warning | 1366 | Incorrect value: '' for column 'xx' at row 9   |<br />
| Warning | 1366 | Incorrect value: '' for column 'xx' at row 10  |<br />
+---------+------+------------------------------------------------+<br />
64 rows in set (0.00 sec)</code></p>
<p>As per above only 64 rows are show. Why?</p>
<p><code>mysql&gt; show variables like 'max_error_count';<br />
+-----------------+-------+<br />
| Variable_name   | Value |<br />
+-----------------+-------+<br />
| max_error_count | 64    |<br />
+-----------------+-------+<br />
1 row in set (0.00 sec)</code></p>
<p>Ok so &#8230; what is the solution?</p>
<p><code>mysql&gt; set max_error_count=65535;<br />
Query OK, 0 rows affected (0.00 sec)</code></p>
<p><code> </code></p>
<p><code>mysql&gt; pager more<br />
PAGER set to 'more'</code></p>
<p>Here I am setting the max_error_count to a high value only for the session and not globally.</p>
<p>Details <a href="http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html#sysvar_max_error_count" target="_blank">here</a></p>
<p>The &#8220;pager more&#8221; will work only on *nix systems where the output will be &#8220;piped&#8221; to the `more` command on your OS and displayed in batches so you can pause the scrolling of the long output.</p>
<p>Having said the above, from my experience, when you have that many warnings, it&#8217;ll be a repetition of the same error or group of errors.</p>
]]></content:encoded>
			<wfw:commentRss>http://mysqlpreacher.com/wordpress/2010/06/show-warnings-with-many-many-warnings/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Automating MySQL access with expect and bash scripting</title>
		<link>http://mysqlpreacher.com/wordpress/2010/02/automating-mysql-access-with-expect-and-bash-scripting/</link>
		<comments>http://mysqlpreacher.com/wordpress/2010/02/automating-mysql-access-with-expect-and-bash-scripting/#comments</comments>
		<pubDate>Mon, 08 Feb 2010 17:08:26 +0000</pubDate>
		<dc:creator>Darren Cassar</dc:creator>
				<category><![CDATA[Databases]]></category>
		<category><![CDATA[Intermediate]]></category>
		<category><![CDATA[OS]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[access]]></category>
		<category><![CDATA[automation]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[expect]]></category>
		<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://mysqlpreacher.com/wordpress/?p=327</guid>
		<description><![CDATA[If you have multiple database servers with strange names, or if you have to hop over multiple machines to connect to any mysql database server, then you know what a pain it can be to administer such a setup. Thanks to some scripting, you can automate such tasks as follows:
Create an expect script:
/path/to/sshmysql.exp
#!/usr/bin/expect -f
#script by [...]]]></description>
			<content:encoded><![CDATA[<p>If you have multiple database servers with strange names, or if you have to hop over multiple machines to connect to any mysql database server, then you know what a pain it can be to administer such a setup. Thanks to some scripting, you can automate such tasks as follows:</p>
<p>Create an expect script:<br />
/path/to/sshmysql.exp</p>
<blockquote><p>#!/usr/bin/expect -f<br />
#script by darren cassar<br />
#mysqlpreacher.com</p>
<p>set machine  [lindex $argv 0]</p>
<p>set timeout -1</p>
<p>spawn ssh username@$machine<br />
match_max 100000<br />
expect -exact &#8220;assword: &#8221;<br />
send &#8212; &#8220;password\r&#8221;<br />
send &#8212; &#8220;sudo -k; sudo su &#8211; mysql\r&#8221;<br />
expect -exact &#8220;sudo -k; sudo su &#8211; mysql&#8221;<br />
expect -exact &#8220;assword:&#8221;<br />
send &#8212; &#8220;password\r&#8221;<br />
interact</p></blockquote>
<p># you should change the word password in &#8217;send &#8212; &#8220;password\r&#8221;&#8216; to your login password<br />
# if you have the same password for each environment you could also script logging into mysql directly from the same expect script BUT that is not recommended.</p>
<p>Create a bash script:<br />
/path/to/login.sh</p>
<blockquote><p>#!/bin/bash<br />
#script by darren cassar<br />
#mysqlpreacher.com</p>
<p>sm=&#8217;/path/to/sshmysql.exp&#8217;</p>
<p>menu() {<br />
  echo &#8221; 101 &#8211; dev.databaseserver1 &#8221;<br />
  echo &#8221; 102 &#8211; dev.databaseserver2 &#8221;<br />
  echo &#8221; 103 &#8211; dev.databaseserver3 &#8221;<br />
  echo &#8221; 201 &#8211; qa.databaseserver1 &#8221;<br />
  echo &#8221; 301 &#8211; uat.databaseserver1 &#8221;<br />
  echo &#8221; 302 &#8211; uat.databaseserver2 &#8221;<br />
  echo &#8221; 401 &#8211; prod.databaseserver1 &#8221;<br />
  echo &#8221; &#8221;<br />
}</p>
<p>ARGUMENT=notmenu</p>
<p>if [ -z "$1" ]<br />
  then<br />
    ARGUMENT=menu<br />
else<br />
  choice=$1<br />
fi</p>
<p>if [ $ARGUMENT = "menu" ]<br />
  then<br />
    menu<br />
else<br />
  case &#8220;$choice&#8221; in<br />
  101|dev.databaseserver1   ) $sm dev.databaseserver1;;<br />
  102|dev.databaseserver2   ) $sm dev.databaseserver2;;<br />
  103|dev.databaseserver3   ) $sm dev.databaseserver3;;<br />
  201|qa.databaseserver1   ) $sm qa.databaseserver1;;<br />
  301|uat.databaseserver1   ) $sm uat.databaseserver1;;<br />
  302|uat.databaseserver2   ) $sm uat.databaseserver2;;<br />
  401|prod.databaseserver1   ) $sm prod.databaseserver1;;<br />
  *        ) echo &#8220;Wrong value passed to script&#8221;<br />
             menu ;;<br />
  esac<br />
fi</p></blockquote>
<blockquote><p>alias l=&#8217;/path/to/login.sh&#8217;</p></blockquote>
<p>Output: </p>
<blockquote><p>[darrencassar@mymachine ~ ]$ l<br />
 101 &#8211; dev.databaseserver1<br />
 102 &#8211; dev.databaseserver2<br />
 103 &#8211; dev.databaseserver3<br />
 201 &#8211; qa.databaseserver1<br />
 301 &#8211; uat.databaseserver1<br />
 302 &#8211; uat.databaseserver2<br />
 401 &#8211; prod.databaseserver1</p></blockquote>
<p>Output:<br />
The below command would log you into the first development database server as mysql user.</p>
<blockquote><p>[darrencassar@mymachine ~ ]$ l 101 </p></blockquote>
<p>On each machine place aliases for each instance in the .profile</p>
<blockquote><p>alias use3306=&#8217;mysql -u root -p -h 127.0.0.1 -P 3306 &#8211;prompt=&#8221;mysql \D> &#8220;&#8216;</p></blockquote>
<p>The above setup can be used using any client/server OS: Linux, Solaris, MAC OS or Windows(running Cygwin)</p>
<p><strong>NOTE: If you store the password in clear text inside the expect script, you should at least save the scripts inside an encrypted partition on your machine and make sure that folder is not shared or accessible by anyone. Another way of doing it would be to use either SSHKeys OR save the password inside a file and encrypt it using <a href="http://www.madboa.com/geek/openssl/#encrypt-simple" target="_blank">OpenSSL</a></strong></p>
<p>Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://mysqlpreacher.com/wordpress/2010/02/automating-mysql-access-with-expect-and-bash-scripting/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>MySQL &#8211; IP vs DNS</title>
		<link>http://mysqlpreacher.com/wordpress/2009/12/mysql-ip-vs-dns/</link>
		<comments>http://mysqlpreacher.com/wordpress/2009/12/mysql-ip-vs-dns/#comments</comments>
		<pubDate>Fri, 04 Dec 2009 15:39:12 +0000</pubDate>
		<dc:creator>Darren Cassar</dc:creator>
				<category><![CDATA[Databases]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[OS]]></category>
		<category><![CDATA[Solaris]]></category>
		<category><![CDATA[cache]]></category>
		<category><![CDATA[dns]]></category>
		<category><![CDATA[grants]]></category>
		<category><![CDATA[hosts]]></category>
		<category><![CDATA[skip-name-resolve]]></category>

		<guid isPermaLink="false">http://mysqlpreacher.com/wordpress/?p=315</guid>
		<description><![CDATA[A MySQL is running happily on a machine situated in a land far far away. I grant access to a user@machine_aaaaaa (grant select on db.* to &#8216;user&#8217;@'machine_aaaaa&#8217; identified by &#8216;password&#8217;; flush privileges;), send an email to the user saying it should run fine and happily go off my way. Mistake!
It seems this user can&#8217;t connect [...]]]></description>
			<content:encoded><![CDATA[<p>A MySQL is running happily on a machine situated in a land far far away. I grant access to a user@machine_aaaaaa (grant select on db.* to &#8216;user&#8217;@'machine_aaaaa&#8217; identified by &#8216;password&#8217;; flush privileges;), send an email to the user saying it should run fine and happily go off my way. Mistake!</p>
<p>It seems this user can&#8217;t connect to the mysql gets access denied:<br />
Access denied for user &#8216;user&#8217;@'machine_bbbbb&#8217; (using password: YES)</p>
<p>Note that the machine the user is being seen from is totally different from the one I set up in the grant!! WHY?</p>
<p>run a reverse lookup on the ip of machine_aaaaa, turns out it shows machine_bbbbb. So I figure a big bad guy messed up /etc/hosts, I was right! `cat /etc/hosts` just to find an entry for machine_aaaaa blehh</p>
<p>Ok, solution is to remove the entry from /etc/hosts (after finding out it wasn&#8217;t even necessary and wasn&#8217;t even supposed to be there in the first place), restart nscd.</p>
<p>Retry<br />
AGAIN &#8211; Access denied for user &#8216;user&#8217;@'machine_bbbbb&#8217; (using password: YES)</p>
<p>What the &#8230;.</p>
<p>What&#8217;s wrong now? &#8212; yeah silly me forgot to `flush hosts` :) </p>
<p>Retry<br />
YOHOO I&#8217;m in!</p>
<p>I&#8217;ve seen quite a few blogs about disabling name resolve in mysql with skip-name-resolve and granting privileges using IPs &#8211; something which would also have avoided the above (but still not found the root of the problem):</p>
<p><a href="http://jeremy.zawodny.com/blog/archives/011421.html">http://jeremy.zawodny.com/blog/archives/011421.html</a><br />
<a href="http://www.mysqlperformanceblog.com/2008/05/31/dns-achilles-heel-mysql-installation/">http://www.mysqlperformanceblog.com/2008/05/31/dns-achilles-heel-mysql-installation/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://mysqlpreacher.com/wordpress/2009/12/mysql-ip-vs-dns/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Call it IRONY</title>
		<link>http://mysqlpreacher.com/wordpress/2009/12/call-it-irony/</link>
		<comments>http://mysqlpreacher.com/wordpress/2009/12/call-it-irony/#comments</comments>
		<pubDate>Fri, 04 Dec 2009 13:32:19 +0000</pubDate>
		<dc:creator>Darren Cassar</dc:creator>
				<category><![CDATA[Databases]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[mysql database connection failed]]></category>

		<guid isPermaLink="false">http://mysqlpreacher.com/wordpress/?p=309</guid>
		<description><![CDATA[WIKIPEDIA -

Irony (from the Ancient Greek εἰρωνεία eirōneía, meaning hypocrisy, deception, or feigned ignorance) is a situation, literary technique or rhetorical device, in which there is an incongruity, discordance or unintended connection that goes beyond the most evident meaning. It is the expression of one&#8217;s meaning by using language that normally signifies the opposite.
Types of [...]]]></description>
			<content:encoded><![CDATA[<p>WIKIPEDIA -</p>
<p><img alt="" src="http://www.mysqlpreacher.com/wordpress/images/Irony.png" title="Irony" class="alignnone" width="1087" height="157" /></p>
<blockquote><p>Irony (from the Ancient Greek εἰρωνεία eirōneía, meaning hypocrisy, deception, or feigned ignorance) is a situation, literary technique or rhetorical device, in which there is an incongruity, discordance or unintended connection that goes beyond the most evident meaning. It is the expression of one&#8217;s meaning by using language that normally signifies the opposite.</p>
<p>Types of irony<br />
Modern theories of rhetoric distinguish among verbal, dramatic and situational irony.<br />
▪	Verbal irony is a disparity of expression and intention: when a speaker says one thing but means another, or when a literal meaning is contrary to its intended effect. An example of this is sarcasm.<br />
▪	Dramatic irony is a disparity of expression and awareness: when words and actions possess a significance that the listener or audience understands, but the speaker or character does not.<br />
<strong> ▪	Situational irony is the disparity of intention and result: when the result of an action is contrary to the desired or expected effect. Likewise, cosmic irony is disparity between human desires and the harsh realities of the outside world (or the whims of the gods). By some definitions, situational irony and cosmic irony are not irony at all.</strong>
</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://mysqlpreacher.com/wordpress/2009/12/call-it-irony/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL vs InfoBright optimizer battle</title>
		<link>http://mysqlpreacher.com/wordpress/2009/12/mysql-vs-infobright-optimizer-battle/</link>
		<comments>http://mysqlpreacher.com/wordpress/2009/12/mysql-vs-infobright-optimizer-battle/#comments</comments>
		<pubDate>Wed, 02 Dec 2009 17:33:36 +0000</pubDate>
		<dc:creator>Darren Cassar</dc:creator>
				<category><![CDATA[Databases]]></category>
		<category><![CDATA[Intermediate]]></category>
		<category><![CDATA[infobright]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[optimiser]]></category>
		<category><![CDATA[variables]]></category>

		<guid isPermaLink="false">http://mysqlpreacher.com/wordpress/?p=302</guid>
		<description><![CDATA[MySQL instance running an Infobright engine

mysql> explain SELECT COUNT(ac.UID) FROM ACTIVE ac JOIN ALL a;
+----+-------------+-------+------+---------------+------+---------+------+---------+-------+
&#124; id &#124; select_type &#124; table &#124; type &#124; possible_keys &#124; key  &#124; key_len &#124; ref  &#124; rows    &#124; Extra &#124;
+----+-------------+-------+------+---------------+------+---------+------+---------+-------+
&#124;  1 &#124; SIMPLE      &#124; ac    &#124; [...]]]></description>
			<content:encoded><![CDATA[<p>MySQL instance running an Infobright engine</p>
<blockquote><p><code lang="sql"><br />
mysql> explain SELECT COUNT(ac.UID) FROM ACTIVE ac JOIN ALL a;<br />
+----+-------------+-------+------+---------------+------+---------+------+---------+-------+<br />
| id | select_type | table | type | possible_keys | key  | key_len | ref  | rows    | Extra |<br />
+----+-------------+-------+------+---------------+------+---------+------+---------+-------+<br />
|  1 | SIMPLE      | ac    | ALL  | NULL          | NULL | NULL    | NULL |  124426 |       |<br />
|  1 | SIMPLE      | a     | ALL  | NULL          | NULL | NULL    | NULL | 7594256 |       |<br />
+----+-------------+-------+------+---------------+------+---------+------+---------+-------+<br />
2 rows in set (0.01 sec)</p>
<p>mysql> SELECT COUNT(ac.UID) FROM ACTIVE ac JOIN ALL a ON ac.UID=a.UID;<br />
+---------------+<br />
| COUNT(ac.UID) |<br />
+---------------+<br />
|         17466 |<br />
+---------------+<br />
1 row in set (0.23 sec)</p>
<p>mysql> set @tot = (SELECT COUNT(ac.UID) FROM ACTIVE ac JOIN ALL a ON ac.UID=a.UID); </p>
<p>^CQuery aborted by Ctrl+C<br />
</code></p></blockquote>
<p>Took more than 60seconds &#8212;- what the &#8230;..<br />
Why did it take a long?</p>
<blockquote><p><code lang="sql"><br />
mysql> set @a=2;<br />
Query OK, 0 rows affected (0.00 sec)</p>
<p>mysql> select @a;<br />
+------+<br />
| @a   |<br />
+------+<br />
| 2    |<br />
+------+<br />
1 row in set (0.00 sec)</p>
<p>mysql> set @tot = (SELECT COUNT(*) FROM ACTIVE);<br />
Query OK, 0 rows affected (0.13 sec)</p>
<p>mysql> select @tot;<br />
+--------+<br />
| @tot   |<br />
+--------+<br />
| 124426 |<br />
+--------+<br />
1 row in set (0.00 sec)</p>
<p>mysql> set @tot = (SELECT COUNT(ac.UID) FROM ACTIVE ac);<br />
Query OK, 0 rows affected (0.22 sec)</p>
<p>mysql> select @tot;<br />
+--------+<br />
| @tot   |<br />
+--------+<br />
| 124426 |<br />
+--------+<br />
1 row in set (0.00 sec)</p>
<p>mysql> SELECT COUNT(ac.UID) FROM ACTIVE ac, ALL a;<br />
+---------------+<br />
| COUNT(ac.UID) |<br />
+---------------+<br />
|  944922897056 |<br />
+---------------+<br />
1 row in set (0.05 sec)</p>
<p>mysql> set @tot=(SELECT COUNT(ac.UID) FROM ACTIVE ac JOIN ALL a);<br />
^CQuery aborted by Ctrl+C<br />
ERROR 1317 (70100): Query execution was interrupted<br />
</code></p></blockquote>
<p>Reason? &#8230;. the query is using the MySQL optimiser rather than the IB one! Why? good question (will have to ask IB devs though).</p>
<p>Work around, use ac temporary table to store the result and setting the variable to the result field, but it&#8217;s really ugly isn&#8217;t it?</p>
]]></content:encoded>
			<wfw:commentRss>http://mysqlpreacher.com/wordpress/2009/12/mysql-vs-infobright-optimizer-battle/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<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>
	</channel>
</rss>
