<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-1135944569112521190</id><updated>2012-02-27T21:47:27.301+01:00</updated><category term='whishlist'/><category term='query cache'/><category term='centos'/><category term='postgresql'/><category term='packaging'/><category term='event scheduler'/><category term='DNS'/><category term='key buffer'/><category term='mysql'/><category term='security'/><category term='UDF'/><category term='ipv4'/><category term='mariadb'/><category term='rhel5'/><category term='storage'/><category term='virtual columns'/><category term='SQLite'/><category term='privileges'/><category term='Drizzle'/><category term='grant'/><category term='oracle'/><category term='myisam'/><category term='timezone'/><category term='certification'/><category term='ssl'/><category term='myql'/><category term='workbench'/><category term='MySQL Enterprise Monitor'/><category term='ipv6'/><category term='rhel6'/><title type='text'>Daniël's Database Blog</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://databaseblog.myname.nl/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1135944569112521190/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://databaseblog.myname.nl/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Daniël van Eeden</name><uri>http://www.blogger.com/profile/14757324605223498151</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/-kM_1-DJNWjU/TfdkYXzFPbI/AAAAAAAAAA8/sBiPJeti0lI/s220/2011-06-11-145156-96.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>27</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-1135944569112521190.post-5886178262849449318</id><published>2011-11-01T11:40:00.000+01:00</published><updated>2011-11-01T11:40:08.932+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='mysql'/><category scheme='http://www.blogger.com/atom/ns#' term='Drizzle'/><title type='text'>Fixed in Drizzle or just different?</title><content type='html'>In a &lt;a href="http://databaseblog.myname.nl/2011/10/same-query-3-databases-3-different.html"&gt;previous post about different output for the same query&lt;/a&gt; there were 3 databases (MySQL, PostgreSQL and SQLite) and 3 different results.&lt;br /&gt;&lt;br /&gt;I attended the "&lt;a href="http://www.percona.com/live/london-2011/session/fixed-in-drizzle-no-more-gotcha-s/"&gt;Fixed in Drizzle: No more GOTCHA's&lt;/a&gt;" talk during Percona Live London. The talk was full of issues which I've encountered many times and which were all fixed. So I wondered whether or not this is already fixed in Drizzle.&lt;br /&gt;&lt;br /&gt;Here is the results for Drizzle:&lt;br /&gt;&lt;pre&gt;drizzle&amp;gt; select version();&lt;br /&gt;+------------+&lt;br /&gt;| version()  |&lt;br /&gt;+------------+&lt;br /&gt;| 2011.03.13 | &lt;br /&gt;+------------+&lt;br /&gt;1 row in set (0.000418 sec)&lt;br /&gt;&lt;br /&gt;drizzle&amp;gt; create database test;&lt;br /&gt;Query OK, 1 row affected (0.000622 sec)&lt;br /&gt;&lt;br /&gt;drizzle&amp;gt; use test;&lt;br /&gt;Reading table information for completion of table and column names&lt;br /&gt;You can turn off this feature to get a quicker startup with -A&lt;br /&gt;&lt;br /&gt;Schema changed&lt;br /&gt;drizzle&amp;gt; create table t1 (id serial, t time);&lt;br /&gt;Query OK, 0 rows affected (0.001479 sec)&lt;br /&gt;&lt;br /&gt;drizzle&amp;gt; insert into t1(t) values ('00:05:10');&lt;br /&gt;Query OK, 1 row affected (0.001717 sec)&lt;br /&gt;&lt;br /&gt;drizzle&amp;gt; select t,t*1.5 from t1;&lt;br /&gt;+----------+-------+&lt;br /&gt;| t        | t*1.5 |&lt;br /&gt;+----------+-------+&lt;br /&gt;| 00:05:10 |   465 | &lt;br /&gt;+----------+-------+&lt;br /&gt;1 row in set (0.000691 sec)&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;And here is the result for MySQL:&lt;br /&gt;&lt;pre&gt;mysql&amp;gt; select version();&lt;br /&gt;+-----------+&lt;br /&gt;| version() |&lt;br /&gt;+-----------+&lt;br /&gt;| 5.6.4-m6  |&lt;br /&gt;+-----------+&lt;br /&gt;1 row in set (0.00 sec)&lt;br /&gt;&lt;br /&gt;mysql&amp;gt; create database test;&lt;br /&gt;Query OK, 1 row affected (0.00 sec)&lt;br /&gt;&lt;br /&gt;mysql&amp;gt; use test;&lt;br /&gt;Database changed&lt;br /&gt;mysql&amp;gt; create table t1 (id serial, t time);&lt;br /&gt;Query OK, 0 rows affected (0.00 sec)&lt;br /&gt;&lt;br /&gt;mysql&amp;gt; insert into t1(t) values ('00:05:10');&lt;br /&gt;Query OK, 1 row affected (0.01 sec)&lt;br /&gt;&lt;br /&gt;mysql&amp;gt; select t,t*1.5 from t1;&lt;br /&gt;+----------+-------+&lt;br /&gt;| t        | t*1.5 |&lt;br /&gt;+----------+-------+&lt;br /&gt;| 00:05:10 |   765 |&lt;br /&gt;+----------+-------+&lt;br /&gt;1 row in set (0.00 sec)&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;I guess that the logic is the same as for MySQL and the difference is due to the microsecond support which is already in Drizzle.&lt;br /&gt;&lt;br /&gt;I've reported this to the Drizzle developers as &lt;a href="https://bugs.launchpad.net/drizzle/+bug/884687"&gt;Bug 884687&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1135944569112521190-5886178262849449318?l=databaseblog.myname.nl' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://databaseblog.myname.nl/feeds/5886178262849449318/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://databaseblog.myname.nl/2011/11/fixed-in-drizzle-or-just-different.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1135944569112521190/posts/default/5886178262849449318'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1135944569112521190/posts/default/5886178262849449318'/><link rel='alternate' type='text/html' href='http://databaseblog.myname.nl/2011/11/fixed-in-drizzle-or-just-different.html' title='Fixed in Drizzle or just different?'/><author><name>Daniël van Eeden</name><uri>http://www.blogger.com/profile/14757324605223498151</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/-kM_1-DJNWjU/TfdkYXzFPbI/AAAAAAAAAA8/sBiPJeti0lI/s220/2011-06-11-145156-96.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1135944569112521190.post-6145188417378447042</id><published>2011-10-12T08:35:00.000+02:00</published><updated>2011-10-12T08:36:30.798+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQLite'/><category scheme='http://www.blogger.com/atom/ns#' term='mysql'/><category scheme='http://www.blogger.com/atom/ns#' term='postgresql'/><title type='text'>Same query, 3 databases, 3 different results</title><content type='html'>The SQL standard leaves a lot of room for different implementations. This is a little demonstration of one of such differences. &lt;br /&gt;&lt;br /&gt;SQLite&amp;nbsp; 3.7.4&lt;br /&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;sqlite&amp;gt; create table t1 (id serial, t time);&lt;br /&gt;sqlite&amp;gt; insert into t1(t) values ('00:05:10');&lt;br /&gt;sqlite&amp;gt; select t,t*1.5 from t1;&lt;br /&gt;00:05:10|0.0&lt;/div&gt;&lt;br /&gt;MySQL 5.6.4-m5&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;mysql&amp;gt; create table t1 (id serial, t time);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;Query OK, 0 rows affected (0.01 sec)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;mysql&amp;gt; insert into t1(t) values ('00:05:10');&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;Query OK, 1 row affected (0.00 sec)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;mysql&amp;gt; select t,t*1.5 from t1;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;+----------+-------+&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;| t&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; | t*1.5 |&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;+----------+-------+&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;| 00:05:10 |&amp;nbsp;&amp;nbsp; 765 |&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;+----------+-------+&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;1 row in set (0.00 sec)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;PostgreSQL 9.0.3&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;test=# create table t1 (id serial, t time);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;NOTICE:&amp;nbsp; CREATE TABLE will create implicit sequence "t1_id_seq" for serial column "t1.id"&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;CREATE TABLE&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;test=# insert into t1(t) values ('00:05:10');&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;INSERT 0 1&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;test=# select t,t*1.5 from t1;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; t&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; | ?column? &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;----------+----------&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&amp;nbsp;00:05:10 | 00:07:45&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;(1 row)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;I think that the behaviour from PostgreSQL is the correct one. MySQL will just remove the :'s to get the string 000510 and then multiplies that value. The behaviour from SQLite is even more strange.&lt;br /&gt;&lt;br /&gt;Of course for MySQL you could use the time_to_sec and sec_to_time functions.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;mysql&amp;gt; select t,sec_to_time(time_to_sec(t)*1.5) from t1;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;+----------+-------------------------------+&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;| t&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; | sec_to_time(time_to_sec(t)*2) |&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;+----------+-------------------------------+&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;| 00:05:10 | 00:07:45 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; |&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;+----------+-------------------------------+&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;1 row in set (0.00 sec)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;But those functions are not available on SQLite.&lt;br /&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;sqlite&amp;gt; select t,sec_to_time(time_to_sec(t)*1.5) from t1;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;Error: no such function: sec_to_time&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1135944569112521190-6145188417378447042?l=databaseblog.myname.nl' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://databaseblog.myname.nl/feeds/6145188417378447042/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://databaseblog.myname.nl/2011/10/same-query-3-databases-3-different.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1135944569112521190/posts/default/6145188417378447042'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1135944569112521190/posts/default/6145188417378447042'/><link rel='alternate' type='text/html' href='http://databaseblog.myname.nl/2011/10/same-query-3-databases-3-different.html' title='Same query, 3 databases, 3 different results'/><author><name>Daniël van Eeden</name><uri>http://www.blogger.com/profile/14757324605223498151</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/-kM_1-DJNWjU/TfdkYXzFPbI/AAAAAAAAAA8/sBiPJeti0lI/s220/2011-06-11-145156-96.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1135944569112521190.post-8475263887436623912</id><published>2011-10-09T19:41:00.000+02:00</published><updated>2011-10-10T08:57:13.395+02:00</updated><title type='text'>How not to grant permissions</title><content type='html'>I went to EuroBSDcon in Maarssen, the Netherlands. It was a great conference and I might write another blog about it.&lt;br /&gt;&lt;br /&gt;I the conference bag there was a copy of the dutch &lt;a href="http://www.linuxmag.nl/"&gt;Linux Magazine&lt;/a&gt;. The magazine is very nice and covers a broad range of topics.&lt;br /&gt;&lt;br /&gt;One article about LogicalDOC caught my attention. The LogicalDOC software uses a MySQL database. and the magazine listed some SQL code about how to create the database user:&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;span style="font-size: x-small;"&gt;create user logicaldoc;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;span style="font-size: x-small;"&gt;set password FOR logicaldoc@´%´=&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;span style="font-size: x-small;"&gt;PASSWORD('wachtwoord´);&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;span style="font-size: x-small;"&gt;grant all privileges on logical-&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;span style="font-size: x-small;"&gt;doc.*&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;span style="font-size: x-small;"&gt;to logicaldoc@´%´ identified by&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;span style="font-size: x-small;"&gt;'wachtwoord´;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;span style="font-size: x-small;"&gt;create database logicaldoc;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;span style="font-size: x-small;"&gt;flush privileges;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;&lt;span style="font-family: inherit; font-size: small;"&gt;These statements won't work as some of the quotes are wrong. But let's ignore that. &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;span style="font-size: x-small;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;After executing the first line the grant is like this:&lt;br /&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;span style="font-size: x-small;"&gt;GRANT USAGE ON *.* TO 'logicaldoc'@'%'&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;So the user logicaldoc is allowed to connect from ANY host WITHOUT password. And yes that does work. &lt;br /&gt;&lt;br /&gt;After the second statement the grant looks like this:&lt;br /&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;span style="font-size: x-small;"&gt;GRANT USAGE ON *.* TO 'logicaldoc'@'%' IDENTIFIED BY PASSWORD '*0CD1AE57344BB752E3A08B733916948E5A4BF96C'&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;Now the user is protected by a password, that's mutch better!&lt;br /&gt;&lt;br /&gt;After the third statement the grants looks like this:&lt;br /&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;&lt;span style="font-size: x-small;"&gt;GRANT USAGE ON *.* TO 'logicaldoc'@'%' IDENTIFIED BY PASSWORD '*0CD1AE57344BB752E3A08B733916948E5A4BF96C'&lt;/span&gt;&lt;/div&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace; font-size: x-small;"&gt;GRANT ALL PRIVILEGES ON `logicaldoc`.* TO 'logicaldoc'@'%'&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt;&lt;span style="font-family: inherit;"&gt;Any user who managed to get a connection after the first statement will still be connected and will now be granted ALL PRIVILEGES including SUPER.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;b&gt;Update:&lt;/b&gt; This will not include the SUPER privilege (Thanks to Shlomi Noach for noticing this.)&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt;&lt;span style="font-family: inherit;"&gt;And of course the flush privileges statement was not necessary because they didn't directly modify the mysql.* tables.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt;&lt;span style="font-family: inherit;"&gt;It should have been like this:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt;&lt;span style="font-family: inherit;"&gt;CREATE USER 'logicaldoc'@'localhost' IDENTIFIED BY 'password';&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt;&lt;span style="font-family: inherit;"&gt;CREATE DATABASE logicaldoc; &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt;&lt;span style="font-family: inherit;"&gt;GRANT SELECT, UPDATE, INSERT,… ON `logicaldoc`.* TO 'logicaldoc'@'localhost';&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt;&lt;span style="font-family: inherit;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt;&lt;span style="font-family: inherit;"&gt;This will continue to work if the NO_AUTO_CREATE_USER sql_mode is set.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;It assumes that the database connection will use a UNIX socket.&lt;br /&gt;&lt;br /&gt;Granting specific rights instead of a simple GRANT ALL is better for security and allows mutch more functionality to work like the read_only setting for slaves, reserved connections for emergencies and the init_connect setting.&lt;br /&gt;&lt;br /&gt;The statements seem to have been copy-pasted from the &lt;a href="http://docs.logicaldoc.com/en/installation/install-on-linux/prepare-the-database.html"&gt;LogicalDOC online documentation&lt;/a&gt;. There they also suggest to supply the root password on the commandline with -ppassword instead of using -p and let MySQL prompt for the password.&lt;br /&gt;&lt;br /&gt;This doesn't mean that LogicalDOC is insecure. It only means that the person writing the documentation probably didn't fully understand MySQL Permissions.&lt;br /&gt;&lt;br /&gt;The &lt;a href="http://technocation.org/content/oursql-episode-59%3A-security-blankets,-part-1"&gt;OurSQL podcast episode 59&lt;/a&gt; has many more information about MySQL and Security.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1135944569112521190-8475263887436623912?l=databaseblog.myname.nl' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://databaseblog.myname.nl/feeds/8475263887436623912/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://databaseblog.myname.nl/2011/10/how-not-to-grant-permissions.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1135944569112521190/posts/default/8475263887436623912'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1135944569112521190/posts/default/8475263887436623912'/><link rel='alternate' type='text/html' href='http://databaseblog.myname.nl/2011/10/how-not-to-grant-permissions.html' title='How not to grant permissions'/><author><name>Daniël van Eeden</name><uri>http://www.blogger.com/profile/14757324605223498151</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/-kM_1-DJNWjU/TfdkYXzFPbI/AAAAAAAAAA8/sBiPJeti0lI/s220/2011-06-11-145156-96.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1135944569112521190.post-5291000840638018202</id><published>2011-07-12T12:12:00.003+02:00</published><updated>2011-07-12T12:14:56.531+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='mysql'/><category scheme='http://www.blogger.com/atom/ns#' term='myisam'/><category scheme='http://www.blogger.com/atom/ns#' term='key buffer'/><title type='text'>MyISAM Key Buffer Usage</title><content type='html'>For MyISAM one of the most important variables is the Key Buffer.&amp;nbsp; The Key Buffer is sometimes called the Key Cache. It's used as a buffer for the indices of MyISAM tables. There is some overhead in the buffer depending on the configured key block size.&lt;br /&gt;&lt;br /&gt;The official way to calculate the key buffer usage as documented in the MySQL Reference manual:&lt;br /&gt;&lt;blockquote&gt;&lt;pre class="programlisting"&gt;1 - ((Key_blocks_unused * key_cache_block_size) / key_buffer_size)&lt;/pre&gt;&lt;/blockquote&gt;&amp;nbsp;This will return the factor, so you have to multiply it with 100 to get the percentage. The Key_blocks_unused is used instead of the more obvious Key_blocks_used. This is due to the fact that Key_blocks_used is the maximum number of key blocks ever used. It will not return to 0 after a FLUSH TABLES.&lt;br /&gt;&lt;br /&gt;This calculation does not take the overhead in account. The key buffer efficiency can be calculated if the key buffer is empty or (has been) completely full.&lt;br /&gt;&lt;br /&gt;If the the key buffer is full:&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;key_buffer_coefficient = key_cache_block_size/(key_buffer_size/Key_blocks_used)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;If the the key buffer is empty:&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;key_buffer_coefficient = key_cache_block_size/(key_buffer_size/Key_blocks_unused)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The 'fixed' formula:&lt;br /&gt;&lt;blockquote&gt;&lt;pre class="programlisting"&gt;1 - ((Key_blocks_unused * key_cache_block_size) / (key_buffer_size * key_buffer_coefficient))&lt;/pre&gt;&lt;/blockquote&gt;&lt;br /&gt;The result is shown below: &lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-S5k4AppjHRo/ThwX1aM7nLI/AAAAAAAAABo/QfTsq3Mdxe4/s1600/kbusage.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="328" src="http://2.bp.blogspot.com/-S5k4AppjHRo/ThwX1aM7nLI/AAAAAAAAABo/QfTsq3Mdxe4/s640/kbusage.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;pre class="programlisting"&gt;&lt;/pre&gt;&lt;/blockquote&gt;The overhead in the key buffer will be allocated on startup, so the larger overhead for a larger key buffer will result in more memory usage, even if MyISAM is only used for the internal mysql tables. &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1135944569112521190-5291000840638018202?l=databaseblog.myname.nl' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://databaseblog.myname.nl/feeds/5291000840638018202/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://databaseblog.myname.nl/2011/07/myisam-key-buffer-usage.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1135944569112521190/posts/default/5291000840638018202'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1135944569112521190/posts/default/5291000840638018202'/><link rel='alternate' type='text/html' href='http://databaseblog.myname.nl/2011/07/myisam-key-buffer-usage.html' title='MyISAM Key Buffer Usage'/><author><name>Daniël van Eeden</name><uri>http://www.blogger.com/profile/14757324605223498151</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/-kM_1-DJNWjU/TfdkYXzFPbI/AAAAAAAAAA8/sBiPJeti0lI/s220/2011-06-11-145156-96.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/-S5k4AppjHRo/ThwX1aM7nLI/AAAAAAAAABo/QfTsq3Mdxe4/s72-c/kbusage.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1135944569112521190.post-2426254408831394260</id><published>2011-07-05T15:34:00.000+02:00</published><updated>2011-07-05T15:34:23.881+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='DNS'/><category scheme='http://www.blogger.com/atom/ns#' term='mysql'/><category scheme='http://www.blogger.com/atom/ns#' term='UDF'/><category scheme='http://www.blogger.com/atom/ns#' term='ipv6'/><title type='text'>Working with IP's in MySQL and MariaDB - Part 2</title><content type='html'>&lt;b&gt;Use DNS directly from your database&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;span style="font-size: x-small;"&gt;mysql&amp;gt; SELECT lookup('localhost');&lt;br /&gt;+---------------------+&lt;br /&gt;| lookup('localhost') |&lt;br /&gt;+---------------------+&lt;br /&gt;| 127.0.0.1           |&lt;br /&gt;+---------------------+&lt;br /&gt;1 row in set (0.00 sec)&lt;br /&gt;&lt;br /&gt;mysql&amp;gt; SELECT reverse_lookup('127.0.0.1');&lt;br /&gt;+-----------------------------+&lt;br /&gt;| reverse_lookup('127.0.0.1') |&lt;br /&gt;+-----------------------------+&lt;br /&gt;| localhost                   |&lt;br /&gt;+-----------------------------+&lt;br /&gt;1 row in set (0.00 sec)&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;This is how you install these functions.&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Build udf_example.so which is in your mysql source. (&lt;a href="http://dev.mysql.com/doc/refman/5.6/en/udf-compiling.html"&gt;make udf_example.so&lt;/a&gt;) &lt;/li&gt;&lt;li&gt;Copy the udf_example.so file from your build directory to your plugin_dir.&lt;/li&gt;&lt;li&gt;Create the lookup and reverse_lookup functions&lt;/li&gt;&lt;/ol&gt;&lt;pre&gt;&lt;span style="font-size: x-small;"&gt;mysql&amp;gt; CREATE FUNCTION lookup RETURNS STRING SONAME 'udf_example.so';&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style="font-size: x-small;"&gt;Query OK, 0 rows affected (0.00 sec)&lt;/span&gt;&lt;span style="font-size: x-small;"&gt; &lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style="font-size: x-small;"&gt;mysql&amp;gt; CREATE FUNCTION reverse_lookup RETURNS STRING SONAME 'udf_example.so';&lt;br /&gt;Query OK, 0 rows affected (0.00 sec)&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style="font-size: x-small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;I've created a &lt;a href="http://bugs.mysql.com/bug.php?id=61750"&gt;feature request&lt;/a&gt; for IPv6 support to these functions.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1135944569112521190-2426254408831394260?l=databaseblog.myname.nl' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://databaseblog.myname.nl/feeds/2426254408831394260/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://databaseblog.myname.nl/2011/07/working-with-ips-in-mysql-and-mariadb_05.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1135944569112521190/posts/default/2426254408831394260'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1135944569112521190/posts/default/2426254408831394260'/><link rel='alternate' type='text/html' href='http://databaseblog.myname.nl/2011/07/working-with-ips-in-mysql-and-mariadb_05.html' title='Working with IP&apos;s in MySQL and MariaDB - Part 2'/><author><name>Daniël van Eeden</name><uri>http://www.blogger.com/profile/14757324605223498151</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/-kM_1-DJNWjU/TfdkYXzFPbI/AAAAAAAAAA8/sBiPJeti0lI/s220/2011-06-11-145156-96.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1135944569112521190.post-2286463780399914330</id><published>2011-07-04T09:34:00.000+02:00</published><updated>2011-07-04T09:34:09.207+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='mysql'/><category scheme='http://www.blogger.com/atom/ns#' term='mariadb'/><category scheme='http://www.blogger.com/atom/ns#' term='ipv6'/><category scheme='http://www.blogger.com/atom/ns#' term='ipv4'/><category scheme='http://www.blogger.com/atom/ns#' term='virtual columns'/><title type='text'>Working with IP's in MySQL and MariaDB</title><content type='html'>For MySQL it's a best practice to store IP addresses in a INT column rather than in a VARCHAR. This allows for more compact storage. This best practice is only for MySQL as PostgreSQL does have data types like &lt;a href="http://www.postgresql.org/docs/9.0/interactive/datatype-net-types.html#DATATYPE-INET"&gt;inet and cidr&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;MySQL is equiped with the INET_ATON() and INET_NTOA() functions since version 3.23.15. In MySQL 5.6.3 the INET6_ATON() and INET6_NTOA() functions were addes to finaly add IPv6 address support. To make it easier to work with IPv4 and IPv6 addresses the IS_IPV4_COMPAT(), IS_IPV4_MAPPED(), IS_IPV4() and IS_IPV6() functions were added. The difference between the new and old functions is that the old functions use INT UNSIGNED to store IP addresses and the new function uses VARBINARY(16) for IPv6 addresses and VARBINARY(4) for IPv4 addresses.&lt;br /&gt;&lt;br /&gt;Here are some examples about how you could do nifty things with IP addresses in MySQL.&lt;br /&gt;&lt;br /&gt;Store hosts and networks in MySQL&lt;br /&gt;&lt;pre&gt;&lt;span style="font-size: x-small;"&gt;CREATE TABLE `hosts` (&lt;br /&gt;`id` int(10) unsigned NOT NULL AUTO_INCREMENT,&lt;br /&gt;`hostname` varchar(255) DEFAULT NULL,&lt;br /&gt;`domainname` varchar(255) DEFAULT NULL,&lt;br /&gt;`ip` int(10) unsigned NOT NULL,&lt;br /&gt;PRIMARY KEY (`id`),&lt;br /&gt;KEY `ip` (`ip`)&lt;br /&gt;)&lt;br /&gt;&lt;br /&gt;CREATE TABLE `networks` (&lt;br /&gt;`id` int(10) unsigned NOT NULL AUTO_INCREMENT,&lt;br /&gt;`network` int(10) unsigned NOT NULL,&lt;br /&gt;`mask` int(10) unsigned NOT NULL,&lt;br /&gt;`name` varchar(255) DEFAULT '',&lt;br /&gt;PRIMARY KEY (`id`),&lt;br /&gt;KEY `network` (`network`),&lt;br /&gt;KEY `mask` (`mask`)&lt;br /&gt;)&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;Insert and retrieve entries&lt;br /&gt;&lt;pre&gt;&lt;span style="font-size: x-small;"&gt;mysql&amp;gt; INSERT INTO `hosts`(`hostname`,`domainname`,`ip`) VALUES('test6','example.com',INET_ATON('192.168.1.2'));&lt;br /&gt;Query OK, 1 row affected (0.00 sec)&lt;br /&gt;&lt;br /&gt;mysql&amp;gt; SELECT * FROM `hosts` WHERE `id`=LAST_INSERT_ID();&lt;br /&gt;+----+----------+-------------+------------+&lt;br /&gt;| id | hostname | domainname  | ip         |&lt;br /&gt;+----+----------+-------------+------------+&lt;br /&gt;|  6 | test6    | example.com | 3232235778 |&lt;br /&gt;+----+----------+-------------+------------+&lt;br /&gt;1 row in set (0.00 sec)&lt;br /&gt;&lt;br /&gt;mysql&amp;gt; SELECT hostname,domainname,INET_NTOA(ip) ip FROM `hosts` WHERE `id`=LAST_INSERT_ID();&lt;br /&gt;+----------+-------------+-------------+&lt;br /&gt;| hostname | domainname  | ip          |&lt;br /&gt;+----------+-------------+-------------+&lt;br /&gt;| test6    | example.com | 192.168.1.2 |&lt;br /&gt;+----------+-------------+-------------+&lt;br /&gt;1 row in set (0.00 sec)&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;Convert a subnetmask to &lt;a href="http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing"&gt;CIDR&lt;/a&gt; notation.&lt;br /&gt;&lt;pre&gt;&lt;span style="font-size: x-small;"&gt;mysql&amp;gt; SELECT INET_ATON('255.255.255.0'),BIT_COUNT(INET_ATON('255.255.255.0'));&lt;br /&gt;+----------------------------+---------------------------------------+&lt;br /&gt;| INET_ATON('255.255.255.0') | BIT_COUNT(INET_ATON('255.255.255.0')) |&lt;br /&gt;+----------------------------+---------------------------------------+&lt;br /&gt;|                 4294967040 |                                    24 |&lt;br /&gt;+----------------------------+---------------------------------------+&lt;br /&gt;1 row in set (0.00 sec)&lt;br /&gt;&lt;br /&gt;mysql&amp;gt; CREATE FUNCTION mask_to_cidr (mask CHAR(15)) RETURNS INT(2) DETERMINISTIC RETURN BIT_COUNT(INET_ATON(mask));&lt;br /&gt;Query OK, 0 rows affected (0.00 sec)&lt;br /&gt;&lt;br /&gt;mysql&amp;gt; SET @mask='255.255.252.0';&lt;br /&gt;Query OK, 0 rows affected (0.00 sec)&lt;br /&gt;&lt;br /&gt;mysql&amp;gt; SELECT @mask,mask_to_cidr(@mask);&lt;br /&gt;+---------------+---------------------+&lt;br /&gt;| @mask         | mask_to_cidr(@mask) |&lt;br /&gt;+---------------+---------------------+&lt;br /&gt;| 255.255.252.0 |                  22 |&lt;br /&gt;+---------------+---------------------+&lt;br /&gt;1 row in set (0.00 sec)&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;And convert a CIDR mask back to &lt;a href="http://en.wikipedia.org/wiki/Dot-decimal_notation"&gt;dot-decimal&lt;/a&gt; notation&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;span style="font-size: x-small;"&gt;mysql&amp;gt; CREATE FUNCTION cidr_to_mask (cidr INT(2)) RETURNS CHAR(15) DETERMINISTIC RETURN INET_NTOA(CONV(CONCAT(REPEAT(1,cidr),REPEAT(0,32-cidr)),2,10));&lt;br /&gt;Query OK, 0 rows affected (0.00 sec)&lt;br /&gt;&lt;br /&gt;mysql&amp;gt; SELECT cidr_to_mask(22);&lt;br /&gt;+------------------+&lt;br /&gt;| cidr_to_mask(22) |&lt;br /&gt;+------------------+&lt;br /&gt;| 255.255.252.0    |&lt;br /&gt;+------------------+&lt;br /&gt;1 row in set (0.00 sec)&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Use the &amp;amp; operator to find the network address using an IP and mask.&lt;br /&gt;&lt;pre&gt;&lt;span style="font-size: x-small;"&gt;mysql&amp;gt; SELECT INET_NTOA(INET_ATON('255.255.255.0') &amp;amp; INET_ATON('192.168.2.3'));&lt;br /&gt;+------------------------------------------------------------------+&lt;br /&gt;| INET_NTOA(INET_ATON('255.255.255.0') &amp;amp; INET_ATON('192.168.2.3')) |&lt;br /&gt;+------------------------------------------------------------------+&lt;br /&gt;| 192.168.2.0                                                      |&lt;br /&gt;+------------------------------------------------------------------+&lt;br /&gt;1 row in set (0.00 sec)&lt;br /&gt;&lt;br /&gt;mysql&amp;gt; SET @netmask='255.255.255.0';&lt;br /&gt;Query OK, 0 rows affected (0.00 sec)&lt;br /&gt;&lt;br /&gt;mysql&amp;gt; SET @ipaddr = '192.168.2.6';Query OK, 0 rows affected (0.00 sec)&lt;br /&gt;&lt;br /&gt;mysql&amp;gt; SELECT CONV(INET_ATON(@ipaddr),10,2) ip,CONV(INET_ATON(@netmask),10,2) mask,CONV(INET_ATON(@ipaddr) &amp;amp; INET_ATON(@netmask),10,2) network\G&lt;br /&gt;*************************** 1. row ***************************&lt;br /&gt;ip: 11000000101010000000001000000110&lt;br /&gt;mask: 11111111111111111111111100000000&lt;br /&gt;network: 11000000101010000000001000000000&lt;br /&gt;1 row in set (0.00 sec)&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;This can be used to join a table with host ip's with a table of networks. (Remember the netmasks table in Solaris and/or NIS?)&lt;br /&gt;&lt;pre&gt;&lt;span style="font-size: x-small;"&gt;mysql&amp;gt; SELECT CONCAT(h.hostname,'.',h.domainname) fqdn, INET_NTOA(h.ip) ip, INET_NTOA(n.mask &amp;amp; h.ip) network, INET_NTOA(n.mask) mask FROM hosts h INNER JOIN networks n ON (n.mask &amp;amp; h.ip) = n.network;&lt;br /&gt;+-------------------+-------------+-------------+---------------+&lt;br /&gt;| fqdn              | ip          | network     | mask          |&lt;br /&gt;+-------------------+-------------+-------------+---------------+&lt;br /&gt;| test1.example.com | 192.168.0.1 | 192.168.0.0 | 255.255.255.0 |&lt;br /&gt;| test2.example.com | 192.168.0.2 | 192.168.0.0 | 255.255.255.0 |&lt;br /&gt;| test3.example.com | 192.168.0.3 | 192.168.0.0 | 255.255.255.0 |&lt;br /&gt;| test4.example.com | 10.0.0.1    | 10.0.0.0    | 255.0.0.0     |&lt;br /&gt;| test5.example.com | 10.0.0.2    | 10.0.0.0    | 255.0.0.0     |&lt;br /&gt;+-------------------+-------------+-------------+---------------+&lt;br /&gt;5 rows in set (0.00 sec)&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;With the ~ operator the mask can be inverted and then be used to find the broadcast address using the XOR operator |.&lt;br /&gt;&lt;pre&gt;&lt;span style="font-size: x-small;"&gt;mysql&amp;gt; SELECT CONV(INET_ATON(@ipaddr),10,2) ip,CONV(INET_ATON(@netmask),10,2) mask,CONV(INET_ATON(@ipaddr) &amp;amp; INET_ATON(@netmask),10,2) network, CONV(CONV(SUBSTRING(CONV(~INET_ATON('255.255.255.0'),10,2),-32),2,10) | INET_ATON(@ipaddr),10,2) broadcast\G&lt;br /&gt;*************************** 1. row ***************************&lt;br /&gt;ip: 11000000101010000000001000000110&lt;br /&gt;mask: 11111111111111111111111100000000&lt;br /&gt;network: 11000000101010000000001000000000&lt;br /&gt;broadcast: 11000000101010000000001011111111&lt;br /&gt;1 row in set (0.00 sec)&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;You could use a view to make it easier for users to select the rows they wanted without using functions. But that will result in a full scan if you search using an IP. MySQL does not optimize this by first converting the search value to an INT but converts all rows to a dot-decimal notation and then compares it. MariaDB has a nifty feature called persistent &lt;a href="http://kb.askmonty.org/en/virtual-columns"&gt;virtual columns&lt;/a&gt; which allow indexing. For the example below this means that instead of scanning all four rows it just uses the index to find the row we need.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;span style="font-size: x-small;"&gt;mysql&amp;gt; CREATE TABLE `iptest`(`ip_n` int(11) UNSIGNED NOT NULL, `ip_a` CHAR(15) AS (INET_NTOA(`ip_n`)) PERSISTENT, PRIMARY KEY(`ip_n`), KEY `ip_a` (`ip_a`));&lt;br /&gt;Query OK, 0 rows affected (0.00 sec)&lt;br /&gt;&lt;br /&gt;mysql&amp;gt; INSERT INTO `iptest`(`ip_n`) VALUES (INET_ATON('192.168.1.1')),(INET_ATON('192.168.1.2')),(INET_ATON('192.168.1.3')),(INET_ATON('192.168.1.4'));&lt;br /&gt;Query OK, 4 rows affected (0.00 sec)&lt;br /&gt;Records: 4  Duplicates: 0  Warnings: 0&lt;br /&gt;&lt;br /&gt;mysql&amp;gt; SELECT * FROM `iptest`;&lt;br /&gt;+------------+-------------+&lt;br /&gt;| ip_n       | ip_a        |&lt;br /&gt;+------------+-------------+&lt;br /&gt;| 3232235777 | 192.168.1.1 |&lt;br /&gt;| 3232235778 | 192.168.1.2 |&lt;br /&gt;| 3232235779 | 192.168.1.3 |&lt;br /&gt;| 3232235780 | 192.168.1.4 |&lt;br /&gt;+------------+-------------+&lt;br /&gt;4 rows in set (0.00 sec)&lt;br /&gt;&lt;br /&gt;mysql&amp;gt; EXPLAIN SELECT * FROM `iptest` WHERE `ip_a`='192.168.1.2';&lt;br /&gt;+----+-------------+--------+------+---------------+------+---------+-------+------+-------------+&lt;br /&gt;| id | select_type | table  | type | possible_keys | key  | key_len | ref   | rows | Extra       |&lt;br /&gt;+----+-------------+--------+------+---------------+------+---------+-------+------+-------------+&lt;br /&gt;|  1 | SIMPLE      | iptest | ref  | ip_a          | ip_a | 16      | const |    1 | Using where |&lt;br /&gt;+----+-------------+--------+------+---------------+------+---------+-------+------+-------------+&lt;br /&gt;1 row in set (0.00 sec)&lt;br /&gt;&lt;br /&gt;mysql&amp;gt; CREATE VIEW v_iptest AS SELECT ip_n,INET_NTOA(ip_n) ip_a FROM `iptest`;&lt;br /&gt;Query OK, 0 rows affected (0.00 sec)&lt;br /&gt;&lt;br /&gt;mysql&amp;gt; EXPLAIN SELECT * FROM `v_iptest` WHERE `ip_a`='192.168.1.2';&lt;br /&gt;+----+-------------+--------+-------+---------------+---------+---------+------+------+--------------------------+&lt;br /&gt;| id | select_type | table  | type  | possible_keys | key     | key_len | ref  | rows | Extra                    |&lt;br /&gt;+----+-------------+--------+-------+---------------+---------+---------+------+------+--------------------------+&lt;br /&gt;|  1 | SIMPLE      | iptest | index | NULL          | PRIMARY | 4       | NULL |    4 | Using where; Using index |&lt;br /&gt;+----+-------------+--------+-------+---------------+---------+---------+------+------+--------------------------+&lt;br /&gt;1 row in set (0.00 sec)&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1135944569112521190-2286463780399914330?l=databaseblog.myname.nl' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://databaseblog.myname.nl/feeds/2286463780399914330/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://databaseblog.myname.nl/2011/07/working-with-ips-in-mysql-and-mariadb.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1135944569112521190/posts/default/2286463780399914330'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1135944569112521190/posts/default/2286463780399914330'/><link rel='alternate' type='text/html' href='http://databaseblog.myname.nl/2011/07/working-with-ips-in-mysql-and-mariadb.html' title='Working with IP&apos;s in MySQL and MariaDB'/><author><name>Daniël van Eeden</name><uri>http://www.blogger.com/profile/14757324605223498151</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/-kM_1-DJNWjU/TfdkYXzFPbI/AAAAAAAAAA8/sBiPJeti0lI/s220/2011-06-11-145156-96.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1135944569112521190.post-1964008559872585366</id><published>2011-06-22T14:32:00.002+02:00</published><updated>2011-06-22T14:48:41.107+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='grant'/><category scheme='http://www.blogger.com/atom/ns#' term='mysql'/><category scheme='http://www.blogger.com/atom/ns#' term='privileges'/><category scheme='http://www.blogger.com/atom/ns#' term='security'/><title type='text'>MySQL privileges and replication</title><content type='html'>This is a response on &lt;a href="http://code.openark.org/blog/mysql/mysql-security-inconsistencies"&gt;MySQL security: inconsistencies&lt;/a&gt; and &lt;a href="http://datacharmer.blogspot.com/2011/06/less-known-facts-about-mysql-user.html"&gt;Less known facts about MySQL user grants&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;As far as I know the privilege to grant PROXY privileges is also not very well understood. I &lt;a href="http://daniel-database.blogspot.com/2011/04/explaining-what-default-proxy-privlige.html"&gt;blogged about that&lt;/a&gt; some time ago.&lt;br /&gt;&lt;br /&gt;In addion to the already highlighted issues with GRANT replication and grants can very well create an unwanted situation:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;span style="font-size:78%;"&gt;master&amp;gt; SHOW GRANTS FOR 'user'@'host'\G&lt;br /&gt;*************************** 1. row ***************************&lt;br /&gt;Grants for user@host: GRANT USAGE ON *.* TO 'user'@'host' IDENTIFIED BY PASSWORD '*4994A78AFED55B0F529C11C436F85458C1F8D4C2'&lt;br /&gt;*************************** 2. row ***************************&lt;br /&gt;Grants for user@host: GRANT SELECT, INSERT, UPDATE, DELETE ON `somedb`.* TO 'user'@'host'&lt;br /&gt;2 rows in set (0.00 sec)&lt;br /&gt;&lt;br /&gt;master&amp;gt; GRANT SELECT,INSERT,UPDATE,DELETE ON anotherdb.* TO 'user'@'host';&lt;br /&gt;Query OK, 0 rows affected (0.00 sec)&lt;br /&gt;&lt;br /&gt;master&amp;gt; SHOW GRANTS FOR 'user'@'host'\G&lt;br /&gt;*************************** 1. row ***************************&lt;br /&gt;Grants for user@host: GRANT USAGE ON *.* TO 'user'@'host' IDENTIFIED BY PASSWORD '*4994A78AFED55B0F529C11C436F85458C1F8D4C2'&lt;br /&gt;*************************** 2. row ***************************&lt;br /&gt;Grants for user@host: GRANT SELECT, INSERT, UPDATE, DELETE ON `somedb`.* TO 'user'@'host'&lt;br /&gt;*************************** 3. row ***************************&lt;br /&gt;Grants for user@host: GRANT SELECT, INSERT, UPDATE, DELETE ON `anotherdb`.* TO 'user'@'host'&lt;br /&gt;3 rows in set (0.00 sec)&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;And on the slave:&lt;br /&gt;&lt;pre&gt;&lt;span style="font-size:78%;"&gt;slave&amp;gt; SHOW GRANTS FOR 'user'@'host'\G&lt;br /&gt;*************************** 1. row ***************************&lt;br /&gt;Grants for user@host: GRANT USAGE ON *.* TO 'user'@'host'&lt;br /&gt;*************************** 2. row ***************************&lt;br /&gt;Grants for user@host: GRANT SELECT, INSERT, UPDATE, DELETE ON `anotherdb`.* TO 'user'@'host'&lt;br /&gt;2 rows in set (0.00 sec)&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;This could have happened if the user was dropped on the slave to prevent it from inserting on a ro-slave. The cure for this issue is setting sql_mode to NO_AUTO_CREATE_USER.&lt;br /&gt;&lt;br /&gt;Another issue is mysql-proxy. MySQL proxy can be used for simple read/write splitting, failover and a lot more. But it could also make your database less secure:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;root is limited to localhost to prevent remote logins&lt;/li&gt;&lt;li&gt;mysql proxy is installed on the database machine &lt;/li&gt;&lt;li&gt;if you connect from a remote machine to mysql-proxy this will be proxied to mysql and the host will be localhost.&lt;/li&gt;&lt;/ul&gt;And the questions for the readers are:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Do you allow access on your read-only slaves?&lt;/li&gt;&lt;li&gt;Do you replicate mysql.* or not? &lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1135944569112521190-1964008559872585366?l=databaseblog.myname.nl' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://databaseblog.myname.nl/feeds/1964008559872585366/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://databaseblog.myname.nl/2011/06/mysql-privileges-and-replication.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1135944569112521190/posts/default/1964008559872585366'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1135944569112521190/posts/default/1964008559872585366'/><link rel='alternate' type='text/html' href='http://databaseblog.myname.nl/2011/06/mysql-privileges-and-replication.html' title='MySQL privileges and replication'/><author><name>Daniël van Eeden</name><uri>http://www.blogger.com/profile/14757324605223498151</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/-kM_1-DJNWjU/TfdkYXzFPbI/AAAAAAAAAA8/sBiPJeti0lI/s220/2011-06-11-145156-96.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1135944569112521190.post-8352923810492580859</id><published>2011-06-19T13:09:00.003+02:00</published><updated>2011-06-20T16:42:39.665+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='event scheduler'/><category scheme='http://www.blogger.com/atom/ns#' term='query cache'/><category scheme='http://www.blogger.com/atom/ns#' term='mysql'/><title type='text'>Regularly flushing the MySQL Query Cache without cron</title><content type='html'>This is a reply on &lt;a href="http://www.fromdual.com/regularly-flushing-mysql-query-cache"&gt;Regularly flushing the MySQL Query Cache&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.flickr.com/photos/alancleaver/4293345633/" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;" title="Alarm Clock 3 by alancleaver_2000, on Flickr"&gt;&lt;img alt="Alarm Clock 3" height="320" src="http://farm5.static.flickr.com/4058/4293345633_cfc8539134.jpg" width="219" /&gt;&lt;/a&gt;&lt;br /&gt;The original acticle is about regulary flushing the MySQL Query Cache as it will fragment over time.&lt;br /&gt;&lt;br /&gt;There are some drawbacks for the cron method for flushing the query cache:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;It will only work on UNIX like platforms as MS Windows uses the task scheduler to schedule tasks. &lt;/li&gt;&lt;li&gt;It needs credentials to login to the database.&lt;/li&gt;&lt;li&gt;It's not included in your database backup &lt;/li&gt;&lt;/ul&gt;There is another method, which is native to MySQL: &lt;a href="http://dev.mysql.com/doc/refman/5.5/en/events.html"&gt;the event scheduler&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Step 1: Enable the event scheduler:&lt;br /&gt;&lt;blockquote&gt;mysql&amp;gt; SET GLOBAL event_scheduler=ON;&lt;br /&gt;Query OK, 0 rows affected (0.00 sec)&lt;/blockquote&gt;&lt;br /&gt;And don't forget to set/change this in your my.cnf or my.ini&lt;br /&gt;&lt;br /&gt;Step 2: Create the event:&lt;br /&gt;&lt;blockquote&gt;mysql&amp;gt; CREATE EVENT flush_query_cache ON SCHEDULE EVERY 1 HOUR DO FLUSH QUERY CACHE;&lt;br /&gt;Query OK, 0 rows affected (0.00 sec)&lt;/blockquote&gt;&lt;blockquote&gt;mysql&amp;gt; SHOW EVENTS\G&lt;br /&gt;*************************** 1. row ***************************&lt;br /&gt;Db: test&lt;br /&gt;Name: flush_query_cache&lt;br /&gt;Definer: msandbox@localhost&lt;br /&gt;Time zone: SYSTEM&lt;br /&gt;Type: RECURRING&lt;br /&gt;Execute at: NULL&lt;br /&gt;Interval value: 1&lt;br /&gt;Interval field: HOUR&lt;br /&gt;Starts: 2011-06-19 12:57:46&lt;br /&gt;Ends: NULL&lt;br /&gt;Status: ENABLED&lt;br /&gt;Originator: 0&lt;br /&gt;character_set_client: utf8&lt;br /&gt;collation_connection: utf8_general_ci&lt;br /&gt;Database Collation: latin1_swedish_ci&lt;br /&gt;1 row in set (0.00 sec)&lt;/blockquote&gt;&lt;br /&gt;Please keep in mind that the query cache doesn't always give you a performance benefit due to mutex contention. See also the &lt;a href="http://dom.as/tech/query-cache-tuner/"&gt;query cache tuner&lt;/a&gt; from &lt;a href="http://dom.as/"&gt;Domas Mituzas&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;You schould create a stored procedure for multi statement and/or complex statements and call the procedure from your event instead of putting it directly in your event.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1135944569112521190-8352923810492580859?l=databaseblog.myname.nl' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://databaseblog.myname.nl/feeds/8352923810492580859/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://databaseblog.myname.nl/2011/06/regularly-flushing-mysql-query-cache.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1135944569112521190/posts/default/8352923810492580859'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1135944569112521190/posts/default/8352923810492580859'/><link rel='alternate' type='text/html' href='http://databaseblog.myname.nl/2011/06/regularly-flushing-mysql-query-cache.html' title='Regularly flushing the MySQL Query Cache without cron'/><author><name>Daniël van Eeden</name><uri>http://www.blogger.com/profile/14757324605223498151</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/-kM_1-DJNWjU/TfdkYXzFPbI/AAAAAAAAAA8/sBiPJeti0lI/s220/2011-06-11-145156-96.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://farm5.static.flickr.com/4058/4293345633_cfc8539134_t.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1135944569112521190.post-2312585137338545059</id><published>2011-06-15T13:43:00.004+02:00</published><updated>2011-06-15T15:15:05.714+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='mysql'/><category scheme='http://www.blogger.com/atom/ns#' term='certification'/><category scheme='http://www.blogger.com/atom/ns#' term='postgresql'/><title type='text'>OSS-DB Database certification</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.oss-db.jp/"&gt;&lt;img style="float:right; margin:0 0 10px 10px;cursor:pointer; cursor:hand;width: 216px; height: 91px;" src="http://2.bp.blogspot.com/-DYM4E9DrkeU/Tfiv-ZWCoNI/AAAAAAAAABc/J6stCYT5YEk/s320/logo.gif" alt="" id="BLOGGER_PHOTO_ID_5618434021634777298" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;What will be first? The new and updated MySQL certification or the new &lt;a href="http://www.oss-db.jp/"&gt;OSS-DB&lt;/a&gt; exam which is announced by LPI in Japan?&lt;br /&gt;&lt;br /&gt;The OSS-DB is only for PostgreSQL for now, but will cover more opensource databases in the future.&lt;br /&gt;&lt;br /&gt;There seem to be two levels:&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;Silver: Management consulting engineers who can improve large-scale database&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Gold: Engineers who can design, development, implementation and operation of the database&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;The google translate version can be found &lt;a href="http://translate.google.com/translate?hl=en&amp;amp;sl=ja&amp;amp;tl=en&amp;amp;u=http%3A%2F%2Fwww.oss-db.jp%2F"&gt;here&lt;/a&gt;. I found this info on &lt;a href="http://pgsqlpgpool.blogspot.com/2011/06/lpi-japan-to-start-postgresql.html"&gt;Tatsuo Ishii's blog&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1135944569112521190-2312585137338545059?l=databaseblog.myname.nl' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://databaseblog.myname.nl/feeds/2312585137338545059/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://databaseblog.myname.nl/2011/06/oss-db-database-certification.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1135944569112521190/posts/default/2312585137338545059'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1135944569112521190/posts/default/2312585137338545059'/><link rel='alternate' type='text/html' href='http://databaseblog.myname.nl/2011/06/oss-db-database-certification.html' title='OSS-DB Database certification'/><author><name>Daniël van Eeden</name><uri>http://www.blogger.com/profile/14757324605223498151</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/-kM_1-DJNWjU/TfdkYXzFPbI/AAAAAAAAAA8/sBiPJeti0lI/s220/2011-06-11-145156-96.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/-DYM4E9DrkeU/Tfiv-ZWCoNI/AAAAAAAAABc/J6stCYT5YEk/s72-c/logo.gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1135944569112521190.post-5265188114693314319</id><published>2011-06-14T10:58:00.001+02:00</published><updated>2011-06-14T11:02:12.782+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='mysql'/><category scheme='http://www.blogger.com/atom/ns#' term='storage'/><title type='text'>RE: A bit on SANs and system dependencies</title><content type='html'>This is a reply on &lt;a href="http://ebergen.net/wordpress/2011/06/13/a-bit-on-sans-and-system-dependencies/"&gt;A bit on SANs and system dependencies&lt;/a&gt; by Eric Bergen.&lt;br /&gt;&lt;br /&gt;Lets first start by making a difference between entry level, midrange and high-end SAN's.&lt;br /&gt;&lt;br /&gt;&lt;i&gt;Entry level:&lt;/i&gt;&lt;br /&gt;This is basically a bunch of disks with a network connection. The Oracle/Sun/StorageTek 2540 is an example for this category. This storage is aimed at lowcost shared storage.&lt;br /&gt;&lt;br /&gt;&lt;i&gt;Midrange:&lt;/i&gt;&lt;br /&gt;This kind of storage generally features replication and more disks than entry level. HP EVA is what comes to mind for this category.  This storage is aimed at a good price/performance.&lt;br /&gt;&lt;br /&gt;&lt;i&gt;High-End:&lt;/i&gt;&lt;br /&gt;This is mainframe style storage which is made usable for open systems. Hitachi Data Systems VSP is a good example of this category. This category is for extreme performance and reliability.&lt;br /&gt;&lt;br /&gt;Please make sure to not (mis-)judge High-End SAN by the experiences you had with entry-level storage.&lt;br /&gt;&lt;br /&gt;Why should we use SAN/NAS storage?&lt;br /&gt;&lt;ul&gt;&lt;li&gt;SAN's can offer more reliable storage than local storage&lt;/li&gt;&lt;li&gt;SAN's offer all kinds of extra services like replication for disaster recovery.&lt;/li&gt;&lt;li&gt;SAN's be used to make machines be easy replaceable. (Diskless, Boot from SAN)&lt;/li&gt;&lt;li&gt;SAN's offer shared storage which can be used to make cluster setups.&lt;/li&gt;&lt;li&gt;SAN's offer server-less backups and snapshots.&lt;/li&gt;&lt;li&gt;SAN's offer storage pooling&lt;/li&gt;&lt;li&gt;Most SAN's offer online upgrade of firmware&lt;/li&gt;&lt;li&gt;SAN's offer online adding and replacement of disks&lt;/li&gt;&lt;/ul&gt;Why shouldn't we use SAN/NAS storage?&lt;br /&gt;&lt;br /&gt;There are many issues which can arise with shared storage. I've encountered many issues with all of the above categories.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Multipath setups which fail due to human error or due to firmware issues.&lt;/li&gt;&lt;li&gt;Storage becomes slow because 1 machine is hammering the SAN. This bottleneck could arise on the network, the storage controller and on the disks.&lt;/li&gt;&lt;li&gt;FC controllers are expensive and so are iSCSI controllers.&lt;/li&gt;&lt;li&gt;Using ethernet might require a seperate network or a upgrade of your current network.&lt;/li&gt;&lt;li&gt;Using SAN/NAS will require a storage administrator in many cases.  &lt;/li&gt;&lt;/ul&gt;Most MySQL setups can offer the same features as a SAN&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Use MySQL (semisync) replication for disaster recovery instead of replication on the SAN level. This offers more efficient replication as statement based (or mixed) replication can be used.&lt;/li&gt;&lt;li&gt;Use DRBD for repliation of disks for cluster setups. Or use a NDB Cluster.&lt;/li&gt;&lt;li&gt;MySQL Enterprise Backup and XtraBackup can provide you with a low-impact backup wich can be used instead of a server-less backup solution. It could even be a no-impact backup when done on a slave. Using server-free backups with MySQL is not always possible.&lt;/li&gt;&lt;li&gt;Using LVM will allow for flexible storage assignment and snapshots, but most filesystems only support growing and do not offer shrinking features. Think of it as the ever-growing ibdata file which happens if you're not using innodb_file_per_table&lt;b&gt; &lt;/b&gt;&lt;/li&gt;&lt;/ul&gt;&lt;b&gt; &lt;/b&gt;&lt;br /&gt;&lt;b&gt;SAN or NAS&lt;/b&gt;&lt;br /&gt;A typical NAS storage array like a NetApp Filer can be accessed using FC nowadays. And most SAN storage vendors do offer NAS heads. So this is not as big of a difference as it once was. SAN is block level storage which uses FC or iSCSI and NAS is file level storage using NFS or CIFS.&lt;br /&gt;MySQL can be used on FC, NFS, iSCSI or any other type of storage. But when sync_binlog=1 and innodb_flush_trx_at_commit=1 is used MySQL will do a lot of fsyncs. This will slow down the storage a lot. A local battery backed RAID array will be much quicker as the network roundtrip will be eliminated. (Beware of raid auto learning!)&lt;br /&gt;&lt;br /&gt;Some virtualization software like VMWare and VirtualBox do offer virtualized disks which can be located on a SAN. Make your virtualization layer is configured correctly to do a proper fsync.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Conclusion:&lt;/b&gt;&lt;br /&gt;There is enough software in the MySQL ecosystem which can bring you SAN-like features with cheap/fast local storage. However if MySQL is not the only software which should be replicated it might be good choice to use a more generic way of managing your storage, this could include a SAN. Using a SAN might allow you to do things like upgrade the firmware of your disks and controllers without doing a failover on your master.&lt;br /&gt;&lt;br /&gt;Do you use SAN/NAS for MySQL? Why? Why not? Do you use SAN features like replication and/or snapshots?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1135944569112521190-5265188114693314319?l=databaseblog.myname.nl' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://databaseblog.myname.nl/feeds/5265188114693314319/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://databaseblog.myname.nl/2011/06/re-bit-on-sans-and-system-dependencies.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1135944569112521190/posts/default/5265188114693314319'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1135944569112521190/posts/default/5265188114693314319'/><link rel='alternate' type='text/html' href='http://databaseblog.myname.nl/2011/06/re-bit-on-sans-and-system-dependencies.html' title='RE: A bit on SANs and system dependencies'/><author><name>Daniël van Eeden</name><uri>http://www.blogger.com/profile/14757324605223498151</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/-kM_1-DJNWjU/TfdkYXzFPbI/AAAAAAAAAA8/sBiPJeti0lI/s220/2011-06-11-145156-96.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1135944569112521190.post-1194843482170834599</id><published>2011-05-16T13:36:00.001+02:00</published><updated>2011-05-16T16:41:31.630+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='mysql'/><category scheme='http://www.blogger.com/atom/ns#' term='certification'/><category scheme='http://www.blogger.com/atom/ns#' term='oracle'/><title type='text'>MySQL Certification</title><content type='html'>According to the Oracle website the following certifications are available for MySQL:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://education.oracle.com/pls/web_prod-plq-dad/db_pages.getpage?page_id=331"&gt;Oracle Certified Associate, MySQL 5.0/5.1/5.5&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://education.oracle.com/pls/web_prod-plq-dad/db_pages.getpage?page_id=332"&gt;Oracle Certified Professional, MySQL 5.0 Developer&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://education.oracle.com/pls/web_prod-plq-dad/db_pages.getpage?page_id=333"&gt;Oracle Certified Professional, MySQL 5.0 Database  Administrator&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://education.oracle.com/pls/web_prod-plq-dad/db_pages.getpage?page_id=334"&gt;Oracle Certified Expert, MySQL 5.1 Cluster Database  Administrator&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;There were two new versions released since MySQL 5.0. MySQL 5.0 was released in 2005, that's more than 5 years ago. And "MySQL 5.1 Cluster Database"? &lt;a href="http://en.wikipedia.org/wiki/MySQL_Cluster#Versions"&gt;According to wikipedia&lt;/a&gt; the NDB release in the 5.1 source tree is old and not maintained. And Cluster 7.1 has many new features like multithreaded data nodes and disk based data.&lt;br /&gt;&lt;br /&gt;So Oracle, please update the certifications.&lt;br /&gt;&lt;ul&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1135944569112521190-1194843482170834599?l=databaseblog.myname.nl' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://databaseblog.myname.nl/feeds/1194843482170834599/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://databaseblog.myname.nl/2011/05/mysql-certification.html#comment-form' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1135944569112521190/posts/default/1194843482170834599'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1135944569112521190/posts/default/1194843482170834599'/><link rel='alternate' type='text/html' href='http://databaseblog.myname.nl/2011/05/mysql-certification.html' title='MySQL Certification'/><author><name>Daniël van Eeden</name><uri>http://www.blogger.com/profile/14757324605223498151</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/-kM_1-DJNWjU/TfdkYXzFPbI/AAAAAAAAAA8/sBiPJeti0lI/s220/2011-06-11-145156-96.jpg'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1135944569112521190.post-294267148073607571</id><published>2011-04-29T15:49:00.000+02:00</published><updated>2011-04-29T15:49:22.265+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='mysql'/><category scheme='http://www.blogger.com/atom/ns#' term='whishlist'/><title type='text'>My MySQL wishlist (revised, again)</title><content type='html'>&amp;nbsp;Just like I did in &lt;a href="http://daniel-database.blogspot.com/2007/11/my-mysql-wishlist.html"&gt;2007&lt;/a&gt; and &lt;a href="http://daniel-database.blogspot.com/2009/07/my-mysql-wishlist-revised.html"&gt;2009&lt;/a&gt;, this is my updated whishlist for MySQL. &lt;br /&gt;&lt;br /&gt;&lt;b&gt;My 2007 List:&lt;/b&gt;&lt;br /&gt;&lt;i&gt;Per user and/or per database quota&lt;/i&gt;&lt;br /&gt;I guess that this will be implemented together with catalog support.&lt;br /&gt;&lt;i&gt;&amp;nbsp;&lt;/i&gt;&lt;br /&gt;&lt;i&gt;External Authentication&amp;nbsp;&lt;/i&gt;&lt;br /&gt;Got it in 5.5! Thanks a lot! And the new MySQL Cluster even has support for &lt;a href="http://www.clusterdb.com/mysql-cluster/sharing-user-credentials-between-mysql-servers-with-cluster/"&gt;sharing user credentials&lt;/a&gt;.&lt;br /&gt;&lt;i&gt;&amp;nbsp;&lt;/i&gt;&lt;br /&gt;&lt;i&gt;Database Locator&lt;/i&gt;&lt;br /&gt;There is still no TNSnames like support. &lt;br /&gt;&lt;br /&gt;&lt;i&gt;Saving extra metadata about the database.&lt;/i&gt;&lt;br /&gt;Using the comment field of tables for things like svn release, customer number and more still just feels wrong. And a database still can't have a comment... Using I_S is possible, but it's not supported to create FK's for that, so consistency is not guaranteed.&lt;br /&gt;&lt;br /&gt;&lt;i&gt;better protection against run-away queries&lt;/i&gt;&lt;br /&gt;With &lt;a href="http://www.maatkit.org/doc/mk-kill.html"&gt;mk-kill&lt;/a&gt; this is now easy.&lt;br /&gt;&lt;br /&gt;&lt;i&gt;restore manager &lt;/i&gt;&lt;br /&gt;I still have to use &lt;a href="http://daniel-database.blogspot.com/2011/03/restore-full-mysqldump-file-wo-mysql.html"&gt;thinks like awk&lt;/a&gt; for this...&lt;br /&gt;&lt;br /&gt;&lt;b&gt;My 2009 List:&lt;/b&gt;&lt;br /&gt;&lt;i&gt;SNMP for statistics&lt;/i&gt;&lt;br /&gt;no changes &lt;br /&gt;&lt;i&gt;&amp;nbsp;&lt;/i&gt;&lt;br /&gt;&lt;i&gt;SNMP for alerting&lt;/i&gt;&lt;br /&gt;MySQL Enterprise Manager is quite good at this. &lt;br /&gt;&lt;br /&gt;&lt;i&gt;Auditing&lt;/i&gt;&lt;br /&gt;There is much more possible with the new plugin features in 5.5&lt;br /&gt;&lt;br /&gt;&lt;b&gt;And now the new entries:&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;i&gt;Sequences&lt;/i&gt;This could make single-row uuid tables redundant&lt;br /&gt;&lt;i&gt;&amp;nbsp;&lt;/i&gt;&lt;br /&gt;&lt;i&gt;Check constraints&lt;/i&gt;&lt;br /&gt;See &lt;a href="http://this%20blog%20entry%20from%20endpoint.com/"&gt;this blog entry from endpoint.com&lt;/a&gt; for the reason why. &lt;br /&gt;&lt;i&gt;&amp;nbsp;&lt;/i&gt;&lt;br /&gt;&lt;i&gt;Multiple triggers with the same action time and event&lt;br /&gt;&amp;nbsp;&lt;/i&gt;&lt;br /&gt;&lt;i&gt;Host cache info&lt;/i&gt;&lt;br /&gt;As explained in &lt;a href="http://bugs.mysql.com/bug.php?id=59404"&gt;Bug #59404&lt;/a&gt; &lt;br /&gt;&lt;br /&gt;&lt;i&gt;Crash-safe UDFs&lt;/i&gt;&lt;br /&gt;A badly written UDF can crash the whole server. This will make the use of UDF's a bit too risky for some. &lt;br /&gt;&lt;br /&gt;What's on your whishlist? A scalable query cache? JSON Features? Multithreaded Slave? Custom datatypes? IPv6?&lt;br /&gt;&lt;ul&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1135944569112521190-294267148073607571?l=databaseblog.myname.nl' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://databaseblog.myname.nl/feeds/294267148073607571/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://databaseblog.myname.nl/2011/04/my-mysql-wishlist-revised-again.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1135944569112521190/posts/default/294267148073607571'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1135944569112521190/posts/default/294267148073607571'/><link rel='alternate' type='text/html' href='http://databaseblog.myname.nl/2011/04/my-mysql-wishlist-revised-again.html' title='My MySQL wishlist (revised, again)'/><author><name>Daniël van Eeden</name><uri>http://www.blogger.com/profile/14757324605223498151</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/-kM_1-DJNWjU/TfdkYXzFPbI/AAAAAAAAAA8/sBiPJeti0lI/s220/2011-06-11-145156-96.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1135944569112521190.post-3026309835703430095</id><published>2011-04-19T14:45:00.001+02:00</published><updated>2011-04-29T13:35:27.807+02:00</updated><title type='text'>Explaining what the default PROXY privilege for root does</title><content type='html'>In a default MySQL 5.5.8 installation there is one PROXY privilege:&lt;br /&gt;&lt;br /&gt;&lt;blockquote style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;GRANT PROXY ON ''@'' TO 'root'@'localhost' WITH GRANT OPTION&lt;/blockquote&gt;&lt;br /&gt;What this does is:&lt;br /&gt;If USER() and CURRENT_USER() don't match root is still allowed to grant the proxy privilege.&lt;br /&gt;&lt;br /&gt;So if you connect using someuser@localhost using LDAP and LDAP tells you're root then you're still allowed to grant proxy privileges. This will only work if your user has the privilege to proxy to root.&lt;br /&gt;&lt;br /&gt;The documentation for PROXY is &lt;a href="http://dev.mysql.com/doc/refman/5.5/en/proxy-users.html"&gt;here&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1135944569112521190-3026309835703430095?l=databaseblog.myname.nl' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://databaseblog.myname.nl/feeds/3026309835703430095/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://databaseblog.myname.nl/2011/04/explaining-what-default-proxy-privlige.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1135944569112521190/posts/default/3026309835703430095'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1135944569112521190/posts/default/3026309835703430095'/><link rel='alternate' type='text/html' href='http://databaseblog.myname.nl/2011/04/explaining-what-default-proxy-privlige.html' title='Explaining what the default PROXY privilege for root does'/><author><name>Daniël van Eeden</name><uri>http://www.blogger.com/profile/14757324605223498151</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/-kM_1-DJNWjU/TfdkYXzFPbI/AAAAAAAAAA8/sBiPJeti0lI/s220/2011-06-11-145156-96.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1135944569112521190.post-471257842774333166</id><published>2011-04-12T10:38:00.001+02:00</published><updated>2011-04-12T10:40:50.838+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MySQL Enterprise Monitor'/><title type='text'>MySQl Enterprise Monitor 2.3.2</title><content type='html'>It's the second point release of MySQL Enterprise Monitor 2.3. And there some nice new features and bugfixes.&lt;br /&gt;&lt;br /&gt;It's now possible to enable or disable event blackout for specific servers easily.&lt;br /&gt;&lt;br /&gt;It should now graph InnoDB with multiple buffer pools correctly. It won't work for 5.5.8 however, see &lt;a href="http://bugs.mysql.com/bug.php?id=60777"&gt;Bug&amp;nbsp;#60777&lt;/a&gt; and &lt;a href="http://bugs.mysql.com/bug.php?id=60777"&gt;Bug&amp;nbsp;#60831&lt;/a&gt; for more info on that. &lt;br /&gt;&lt;br /&gt;Read the complete &lt;a href="http://dev.mysql.com/doc/mysql-monitor/2.3/en/mem-news-2-3-2.html"&gt;changelogs&lt;/a&gt; for all the details. &lt;br /&gt;&lt;br /&gt;The Advisors/Rules were also updated. But there is still room for improvement: &lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://bugs.mysql.com/bug.php?id=60828"&gt;Bug&amp;nbsp;#60828&lt;/a&gt;   Add rule to detect duplicate foreign keys&lt;/li&gt;&lt;li&gt;&lt;a href="http://bugs.mysql.com/bug.php?id=60697"&gt;Bug&amp;nbsp;#60697&lt;/a&gt;   False Positives for Root Account Can Login Remotely&lt;/li&gt;&lt;li&gt;&lt;a href="http://bugs.mysql.com/bug.php?id=60695"&gt;Bug&amp;nbsp;#60695&lt;/a&gt;   False positives for tables w/o keys for 5.5 with perf schema&lt;/li&gt;&lt;li&gt;&lt;a href="http://bugs.mysql.com/bug.php?id=60677"&gt;Bug&amp;nbsp;#60677&lt;/a&gt;   "User Has Rights To Database That Does Not Exist" gives false positives&lt;/li&gt;&lt;li&gt;&lt;a href="http://bugs.mysql.com/bug.php?id=60676"&gt;Bug&amp;nbsp;#60676&lt;/a&gt;   Add rule to monitor if the timezone info is loaded&lt;/li&gt;&lt;li&gt;&lt;a href="http://bugs.mysql.com/bug.php?id=60587"&gt;Bug&amp;nbsp;#60587&lt;/a&gt;   Advice for Root Account Without Password is not correct &lt;/li&gt;&lt;li&gt; &lt;a href="http://bugs.mysql.com/bug.php?id=60586"&gt;Bug&amp;nbsp;#60586&lt;/a&gt;   key buffer size check gives false positives&lt;/li&gt;&lt;/ul&gt;See also my previous blog posts: &lt;br /&gt;&lt;ul&gt;&lt;li&gt; &lt;a href="http://daniel-database.blogspot.com/2011/04/mysql-and-packaging.html"&gt;MySQL and Packaging&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://daniel-database.blogspot.com/2011/04/how-mysql-monitor-agent-broke-sendmail.html"&gt;How the MySQL Monitor Agent broke Sendmail&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://daniel-database.blogspot.com/2011/03/mysql-timezone-support-updating-and.html"&gt;MySQL Timezone support: Updating and Monitoring&lt;/a&gt;&amp;nbsp;&lt;/li&gt;&lt;/ul&gt;MySQL Enterprise is very easy to install, update and configure. Extending is very well possible using custom SQL queries and Lua scripting, but not really easy. Adding more graphs is also quite hard.&lt;br /&gt;&lt;br /&gt;The graphs look way better than many other tools available. The size is easily configurable so that the graph is as wide as your screen.&lt;br /&gt;&lt;br /&gt;The combination with the &lt;a href="http://www.mysql.com/products/enterprise/query.html"&gt;Query Analyzer&lt;/a&gt; is nice, but I'm not really using it very often as it requires a MySQL Proxy instance to capture the query info. They're fixing that my integrating query capture in Connector/J, Connector/NET and the PHP Connector (the later is only a beta). There are also other ways to capture queries in MySQL: using the &lt;a href="http://karlssonondatabases.blogspot.com/2011/03/sqlstats-13-released.html"&gt;sqlstats plugin&lt;/a&gt;, so there are lots of possibilities for the query analyzer to become much more useful.&lt;br /&gt;&lt;br /&gt;The downside of MySQL Enterprise Monitor is that the tool itself is not free or opensource. It does use an opensource environment: Tomcat, Lua and many opensource Java classes.&lt;br /&gt;&lt;br /&gt;Reporting Bugs and Feature request works really well, and lots and lots of issues which I encountered were fixed.&lt;br /&gt;&lt;br /&gt;MySQL Monitor is one of the top reasons to choose the MySQL Enterprise Subscription.&lt;br /&gt;&lt;br /&gt;And some questions for the readers of this post:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;What are you using for monitoring? &lt;/li&gt;&lt;li&gt; Are you using MEM? Are you satisfied with it? Why? Why not?&lt;/li&gt;&lt;li&gt;If you are using Nagios/Cacti: Which checks/templates do you use?&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1135944569112521190-471257842774333166?l=databaseblog.myname.nl' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://databaseblog.myname.nl/feeds/471257842774333166/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://databaseblog.myname.nl/2011/04/mysql-enterprise-monitor-232.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1135944569112521190/posts/default/471257842774333166'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1135944569112521190/posts/default/471257842774333166'/><link rel='alternate' type='text/html' href='http://databaseblog.myname.nl/2011/04/mysql-enterprise-monitor-232.html' title='MySQl Enterprise Monitor 2.3.2'/><author><name>Daniël van Eeden</name><uri>http://www.blogger.com/profile/14757324605223498151</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/-kM_1-DJNWjU/TfdkYXzFPbI/AAAAAAAAAA8/sBiPJeti0lI/s220/2011-06-11-145156-96.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1135944569112521190.post-89362072684570763</id><published>2011-04-08T16:49:00.000+02:00</published><updated>2011-04-08T16:49:43.131+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='packaging'/><category scheme='http://www.blogger.com/atom/ns#' term='mysql'/><title type='text'>MySQL and Packaging</title><content type='html'>The MySQL Server from Oracle comes in a two different flavours: Community Edition and Enterprise Edition. The first one is under the GPLv2 license and the later is under the GPLv2 or Commercial license.&lt;br /&gt;&lt;br /&gt;The Enterprise Edition was always available from &lt;a href="https://enterprise.mysql.com/"&gt;https://enterprise.mysql.com&lt;/a&gt; (which now has an expired SSL certificate) under the GPLv2 license. This download page was restricted to paying customers. Since the Enterprise downloads were moved to https://edelivery.oracle.com the downloads are available for everyone (as long as it's not restricted by export regulations and accept the trial license agreement). The license is now 'Commercial'. The download be named V24071-01.zip or something like that, which is annoying. The latest version for the Enterprise release on edelivery is 5.5.8 while the latest Community version is 5.5.11. Previously there were two enterprise releases: Advanced (With partitioning) and Professional (Without partitioning). If you use &lt;a href="https://support.oracle.com/"&gt;https://support.oracle.com&lt;/a&gt; you can search for patch 12332498 which claims to contain MySQL Advanced Server 5.5.11. The download is named 'p12332498_55_Linux-x86-64.zip' which is a bit better than the filenames which edelivery generates.&lt;br /&gt;&lt;br /&gt;Oracle does provide RPM's and Generic Tarballs, but no Debian packages. And Debian/Ubuntu is used a lot, even in bigger companies. There is no yum repository available for MySQL Enterprise, so there a no auto updates and easy installs. There is an &lt;a href="http://public-yum.oracle.com/"&gt;official and public yum repository&lt;/a&gt; available but that's only for Oracle Enterprise Linux and Oracle VM. And their Solaris repository also doesn't have the latest MySQL versions (Only 5.0 and 5.1).&lt;br /&gt;&lt;br /&gt;The MySQL Enterprise Subscription also contains MySQL Enterprise Monitor, MySQL Enterprise Backup and MySQL Workbench. There were RPM's available for the MySQL Enterprise Agent, but it turn's out &lt;a href="http://bugs.mysql.com/bug.php?id=60754"&gt;that that was a mistake&lt;/a&gt;. The official way is to use the installer (Yes &lt;a href="http://dev.mysql.com/doc/mysql-monitor/2.3/en/mem-unattended-installation.html"&gt;unattended installation&lt;/a&gt; is possible). But no update via yum/apt or any other method. Just run de agent update installer on every machine.&lt;br /&gt;&lt;br /&gt;For the Community version there is also no YUM or APT repository and that might be one of the reasons why every one sticks to the old versions which are shipped with their Linux distribution of choice. It would be much easier to install packages with a hard dependency on mysql together with the latest official mysql if there were deb packages available. For more info about when not to use yum/apt read &lt;a href="http://code.openark.org/blog/mysql/to-not-yum-or-to-not-apt-get"&gt;Shlomi Noach's blogpost&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;There are deb's for MySQL Workbench available and there are also RPM's, but unfortunately &lt;a href="http://bugs.mysql.com/bug.php?id=60336"&gt;the dependencies are not complete RHEL6&lt;/a&gt;. &lt;br /&gt;&lt;br /&gt;Percona is a good example about how it should be done. Their &lt;a href="http://www.percona.com/docs/wiki/repositories:start"&gt;repositories&lt;/a&gt; are accessible via APT and YUM. There are no repositories for Solaris and Windows yet, but I don't know if anyone is really interested in that.&lt;br /&gt;&lt;br /&gt;How do most folks keep there mysql servers updated? How do you monitor if there are any security related updates available? Do you use an in house YUM/APT/WSUS repository?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1135944569112521190-89362072684570763?l=databaseblog.myname.nl' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://databaseblog.myname.nl/feeds/89362072684570763/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://databaseblog.myname.nl/2011/04/mysql-and-packaging.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1135944569112521190/posts/default/89362072684570763'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1135944569112521190/posts/default/89362072684570763'/><link rel='alternate' type='text/html' href='http://databaseblog.myname.nl/2011/04/mysql-and-packaging.html' title='MySQL and Packaging'/><author><name>Daniël van Eeden</name><uri>http://www.blogger.com/profile/14757324605223498151</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/-kM_1-DJNWjU/TfdkYXzFPbI/AAAAAAAAAA8/sBiPJeti0lI/s220/2011-06-11-145156-96.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1135944569112521190.post-6136996290510202266</id><published>2011-04-04T15:22:00.000+02:00</published><updated>2011-04-04T15:22:41.281+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='rhel5'/><category scheme='http://www.blogger.com/atom/ns#' term='mysql'/><title type='text'>How the MySQL Monitor Agent broke Sendmail</title><content type='html'>For MySQL Enterprise Monitor an agent is required. I've downloaded &lt;br /&gt;V23981-01.zip from &lt;a href="https://edelivery.oracle.com/"&gt;https://edelivery.oracle.com&lt;/a&gt; which contains mysqlmonitoragent-2.3.1.2044-linux-glibc2.3-x86-64bit-installer.rpm&lt;br /&gt;&lt;br /&gt;When I was testing the email alerting for my backup script I got an error:&lt;br /&gt;&lt;pre class="note"&gt;/etc/mail/submit.cf: line 544: fileclass: cannot open '/etc/mail/trusted-users': Group&lt;br /&gt;writable directory&lt;/pre&gt;&lt;br /&gt;Luckily RPM was able to tell me that mysqlmonitoragent had set / to the wrong permissions.&lt;br /&gt;&lt;pre class="note"&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre class="note"&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre class="note"&gt;# rpm -qf /&lt;br /&gt;filesystem-2.4.0-3.el5&lt;br /&gt;mysqlmonitoragent-2.3.1.2044-0&lt;br /&gt;# rpm -qvl mysqlmonitoragent-2.3.1.2044-0 | head -1&lt;br /&gt;drwxrwxr-x    2 root    root                0 Nov 25 01:51 /&lt;br /&gt;# rpm -qvl filesystem-2.4.0-3.el5 | head -1&lt;br /&gt;drwxr-xr-x    2 root    root                0 Oct  1  2009 /&lt;br /&gt;# echo test | mail -s test user@example.com&lt;br /&gt;# /etc/mail/submit.cf: line 544: fileclass: cannot open '/etc/mail/trusted-users': Group&lt;br /&gt;writable directory&lt;/pre&gt;&lt;br /&gt;I've filed &lt;a href="http://bugs.mysql.com/bug.php?id=60752"&gt;Bug #60752&lt;/a&gt; for this. So watch out for this bug if you're using mysqlmonitoragent RPM's!&lt;br /&gt;&lt;br /&gt;The work-around is to do a "chmod 755 /".&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1135944569112521190-6136996290510202266?l=databaseblog.myname.nl' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://databaseblog.myname.nl/feeds/6136996290510202266/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://databaseblog.myname.nl/2011/04/how-mysql-monitor-agent-broke-sendmail.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1135944569112521190/posts/default/6136996290510202266'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1135944569112521190/posts/default/6136996290510202266'/><link rel='alternate' type='text/html' href='http://databaseblog.myname.nl/2011/04/how-mysql-monitor-agent-broke-sendmail.html' title='How the MySQL Monitor Agent broke Sendmail'/><author><name>Daniël van Eeden</name><uri>http://www.blogger.com/profile/14757324605223498151</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/-kM_1-DJNWjU/TfdkYXzFPbI/AAAAAAAAAA8/sBiPJeti0lI/s220/2011-06-11-145156-96.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1135944569112521190.post-4770541020508446490</id><published>2011-03-28T14:54:00.002+02:00</published><updated>2011-03-28T15:38:38.409+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='timezone'/><category scheme='http://www.blogger.com/atom/ns#' term='mysql'/><title type='text'>MySQL Timezone support: Updating and Monitoring</title><content type='html'>&lt;span style="font-weight: bold;"&gt;How old is your timezone info?&lt;/span&gt;&lt;br /&gt;As the &lt;a href="http://en.wikipedia.org/wiki/Tz_database"&gt;timezone database&lt;/a&gt; gets updated frequently, it's important to update the internal timezone database in MySQL. This is needed for the &lt;a href="http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html#function_convert-tz"&gt;CONVERT_TZ()&lt;/a&gt; function for work properly.&lt;br /&gt;&lt;br /&gt;It's not easy to determine if the data in mysql is older than the data from the tzdata database. It get's a bit better if you use this hack before importing the zone database:&lt;br /&gt;&lt;blockquote&gt;ALTER TABLE mysql.time_zone_transition ADD COLUMN `Last_Update` TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;&lt;/blockquote&gt;I've created &lt;a href="http://bugs.mysql.com/bug.php?id=60675"&gt;Bug #60675&lt;/a&gt; to get the system database updated.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Which database serves still need timezone info?&lt;br /&gt;&lt;/span&gt;Use &lt;a href="http://mysql.com/products/enterprise/monitor.html"&gt;MySQL Enterprise Monitor&lt;/a&gt; with &lt;a href="http://dev.mysql.com/doc/mysql-monitor/2.3/en/mem-customizing.html"&gt;custom rules&lt;/a&gt;.&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;1. Add data query&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;Open /opt/mysql/enterprise/agent/share/mysql-monitor-agent/items/custom.xml in an editor and add this:&lt;span style="font-weight: bold;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;    &lt;blockquote&gt;&amp;lt;class&amp;gt;&lt;br /&gt;      &amp;lt;namespace&amp;gt;mysql&amp;lt;/namespace&amp;gt;&lt;br /&gt;      &amp;lt;classname&amp;gt;tzdata_available&amp;lt;/classname&amp;gt;&lt;br /&gt;      &amp;lt;query&amp;gt;&amp;lt;!--[CDATA[SELECT CONVERT_TZ(NOW(),'GMT','MET') IS NOT NULL]]--&amp;gt;&amp;lt;/query&amp;gt;&lt;br /&gt;  &amp;lt;/class&amp;gt;&amp;lt;/blockquote&amp;gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;2. Restart the mysql-monitor-agent&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;3. Create a custom rule in the MySQL Enterprise Dashboard &lt;/span&gt;(Advisor→Manage Rules→create rule):&lt;span style="font-weight: bold;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;Rule Name: Timezone data is not loaded.&lt;br /&gt;Expression: %tzdata_avail% == THRESHOLD&lt;br /&gt;Critical: 0&lt;br /&gt;Variable Assignment&lt;br /&gt;Variable: %tzdata_avail%&lt;br /&gt;Data Item: mysql:tzdata_available:tzdata_available&lt;br /&gt;Instance: local&lt;br /&gt;Default Frequency: 30 minutes&lt;br /&gt;&lt;br /&gt;Problem Description: "There is no timezone info loaded in mysql. This causes the CONVERT_TZ() function to return NULL instead of the requested conversion."&lt;br /&gt;&lt;br /&gt;Advice: "None Specified"&lt;br /&gt;&lt;br /&gt;Recommended Action: "Use the mysql_tzinfo_to_sql utility to convert the zoneinfo database to SQL and load the converted data into the mysql database."&lt;br /&gt;Links and Further Reading:&lt;br /&gt;* {moreInfo:mysql_tzinfo_to_sql — Load the Time Zone Tables|http://dev.mysql.com/doc/refman/5.5/en/mysql-tzinfo-to-sql.html}&lt;br /&gt;* {moreInfo:MySQL Server Time Zone Support|http://dev.mysql.com/doc/refman/5.5/en/time-zone-support.html}&lt;span style="font-weight: bold;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;4. Add the rule to a schedule&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1135944569112521190-4770541020508446490?l=databaseblog.myname.nl' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://databaseblog.myname.nl/feeds/4770541020508446490/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://databaseblog.myname.nl/2011/03/mysql-timezone-support-updating-and.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1135944569112521190/posts/default/4770541020508446490'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1135944569112521190/posts/default/4770541020508446490'/><link rel='alternate' type='text/html' href='http://databaseblog.myname.nl/2011/03/mysql-timezone-support-updating-and.html' title='MySQL Timezone support: Updating and Monitoring'/><author><name>Daniël van Eeden</name><uri>http://www.blogger.com/profile/14757324605223498151</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/-kM_1-DJNWjU/TfdkYXzFPbI/AAAAAAAAAA8/sBiPJeti0lI/s220/2011-06-11-145156-96.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1135944569112521190.post-4964699221076559325</id><published>2011-03-28T13:05:00.004+02:00</published><updated>2011-03-28T14:54:23.587+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='mysql'/><category scheme='http://www.blogger.com/atom/ns#' term='security'/><title type='text'>SQL injection on MySQL.com</title><content type='html'>For those who didn't know it already: MySQL.com was "hacked" last weekend. There also was a report about SQL injection on 2 Sun.com domains.&lt;br /&gt;&lt;br /&gt;I haven't seen an announcement from Oracle yet.&lt;br /&gt;&lt;br /&gt;More info on:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://seclists.org/fulldisclosure/2011/Mar/309"&gt;http://seclists.org/fulldisclosure/2011/Mar/309&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://tinkode27.baywords.com/sun-com-sun-mycrosystems-vulnerable-sql-injection/"&gt;http://tinkode27.baywords.com/sun-com-sun-mycrosystems-vulnerable-sql-injection/&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1135944569112521190-4964699221076559325?l=databaseblog.myname.nl' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://databaseblog.myname.nl/feeds/4964699221076559325/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://databaseblog.myname.nl/2011/03/sql-injection-on-mysqlcom.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1135944569112521190/posts/default/4964699221076559325'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1135944569112521190/posts/default/4964699221076559325'/><link rel='alternate' type='text/html' href='http://databaseblog.myname.nl/2011/03/sql-injection-on-mysqlcom.html' title='SQL injection on MySQL.com'/><author><name>Daniël van Eeden</name><uri>http://www.blogger.com/profile/14757324605223498151</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/-kM_1-DJNWjU/TfdkYXzFPbI/AAAAAAAAAA8/sBiPJeti0lI/s220/2011-06-11-145156-96.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1135944569112521190.post-5486000978071616292</id><published>2011-03-10T16:40:00.002+01:00</published><updated>2011-03-10T16:51:07.971+01:00</updated><title type='text'>Restore a full mysqldump file w/o the mysql database</title><content type='html'>So you've got a database dump of a few gigabytes and you wat to restore all databases except one. Using vi won't work as the file is too large to be easily edited. But luckily an awk oneliner does do the job.&lt;br /&gt;&lt;br /&gt;&lt;blockquote style="font-family: courier new;"&gt;gawk '/^CREATE DATABASE.*/ { db=substr($7,2); db=substr(db,1,length(db)-1) } /^/ {if (db !=&lt;br /&gt;"mysql") { print }}' original_dump.sql &gt; original_dump_wo_mysql.sql&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;The same awk code , but now formatted for readability:&lt;br /&gt;&lt;blockquote style="font-family: courier new;"&gt;/^CREATE DATABASE.*/&lt;br /&gt;{&lt;br /&gt;  db=substr($7,2);&lt;br /&gt;  db=substr(db,1,length(db)-1)&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;/^/&lt;br /&gt;{&lt;br /&gt;  if (db != "mysql") {&lt;br /&gt;    print&lt;br /&gt;  }&lt;br /&gt;}&lt;/blockquote&gt;Of course you could pipe it directly into mysql saving some space on the filesystem. And you could also do the same with perl/python.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1135944569112521190-5486000978071616292?l=databaseblog.myname.nl' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://databaseblog.myname.nl/feeds/5486000978071616292/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://databaseblog.myname.nl/2011/03/restore-full-mysqldump-file-wo-mysql.html#comment-form' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1135944569112521190/posts/default/5486000978071616292'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1135944569112521190/posts/default/5486000978071616292'/><link rel='alternate' type='text/html' href='http://databaseblog.myname.nl/2011/03/restore-full-mysqldump-file-wo-mysql.html' title='Restore a full mysqldump file w/o the mysql database'/><author><name>Daniël van Eeden</name><uri>http://www.blogger.com/profile/14757324605223498151</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/-kM_1-DJNWjU/TfdkYXzFPbI/AAAAAAAAAA8/sBiPJeti0lI/s220/2011-06-11-145156-96.jpg'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1135944569112521190.post-753137758684247021</id><published>2011-03-10T14:21:00.006+01:00</published><updated>2011-03-10T15:50:40.151+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='mysql'/><category scheme='http://www.blogger.com/atom/ns#' term='ssl'/><category scheme='http://www.blogger.com/atom/ns#' term='security'/><title type='text'>Using SSL with MySQL</title><content type='html'>Since MySQL 4.0 it's possible to use SSL to secure the connections to MySQL. Unfortunately this is not used very often.&lt;br /&gt;&lt;br /&gt;It can be used for cient-server connections and for &lt;a href="http://dev.mysql.com/doc/refman/5.5/en/replication-solutions-ssl.html"&gt;replication&lt;/a&gt;. It will encrypt your traffic and prevent man-in-the-middle attacks if you're using ssl-verify-server-cert when connecting using mysql.&lt;br /&gt;&lt;br /&gt;Securing database communication can be required to be compliant to some regulations.&lt;br /&gt;&lt;br /&gt;There are other means of preventing anyone from snooping your database traffic like VPN, SSH Tunneling or stunnel.&lt;br /&gt;&lt;br /&gt;As usual &lt;a href="http://dev.mysql.com/doc/refman/5.5/en/secure-connections.html"&gt;the documentation&lt;/a&gt; is quite good. The only issue with the docs is that  the verification step is missing. (&lt;a href="http://bugs.mysql.com/bug.php?id=59628"&gt;Bug #59628&lt;/a&gt;).&lt;br /&gt;&lt;br /&gt;I'ts quite hard to debug as the OpenSSL messages are not reported in MySQL's errors. Bug luckily that's changing as &lt;a href="http://bugs.mysql.com/bug.php?id=21287"&gt;Bug #21287&lt;/a&gt; does have &lt;a href="http://lists.mysql.com/commits/129271"&gt;a patch&lt;/a&gt; under SCA/OCA.&lt;br /&gt;&lt;br /&gt;And you should check your my.cnf for typo's when it's not working as mysqld won't tell you when it can't find the ssl-ca file. (&lt;a href="http://bugs.mysql.com/bug.php?id=59630"&gt;Bug #59630&lt;/a&gt;).&lt;br /&gt;&lt;br /&gt;I've used tcpdump to capture network traffic when SSL didn't work and loaded it into wireshark. Wireshark has very neat features to decode all kinds of traffic (HTTP, MySQL, SSL and even FC).&lt;br /&gt;&lt;br /&gt;Also &lt;a href="http://dev.mysql.com/doc/refman/5.5/en/compiling-for-debugging.html"&gt;a debug build&lt;/a&gt; can provide you with some more info.&lt;br /&gt;&lt;br /&gt;MySQL uses the same port for SSL and non-SSL connections. So you don't have to change your firewall rules. This also means that you can't force SSL on your firewall.&lt;br /&gt;&lt;br /&gt;There are a few SSL status variables availables in the output of SHOW GLOBAL STATUS LIKE 'Ssl_%';   The documetation is &lt;a href="http://dev.mysql.com/doc/refman/5.5/en/server-status-variables.html"&gt;here&lt;/a&gt;. The only issue is that it doesn't actually work. (&lt;a href="http://bugs.mysql.com/bug.php?id=59635"&gt;Bug #59635&lt;/a&gt;). This is bad as statistics about renegotiation could indicate&lt;a href="http://isc.sans.edu/diary.html?storyid=7534"&gt; renegotiation vulnerabilities&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;To force SSL you should use REQUIRE SSL or REQUIRE X509 with your CREATE USER or GRANT statements. Optionally you could use the REQUIRE SUBJECT, but that only works if the RDN order is how the server expects it to be (&lt;a href="http://bugs.mysql.com/bug.php?id=59376"&gt;Bug #59376&lt;/a&gt;).&lt;br /&gt;&lt;br /&gt;There are also some known issues with mixing OpenSSL and YaSSL your should be aware of.&lt;br /&gt;&lt;br /&gt;Using SSL is very well possible, but there is room for improvement.&lt;br /&gt;&lt;br /&gt;I haven't tested the performance impact of using SSL. I would also be interesting to see if the hardware SSL in the Sun T2 cpu would speed this up. (&lt;a href="http://www.sun.com/blueprints/0306/819-5782.pdf"&gt;Sun T2 PDF&lt;/a&gt;). So Percona/Oracle: start your benchmarks!&lt;br /&gt;&lt;br /&gt;As far as I known the MySQL branch/forks like Percona Server and MariaDB are using almost the same code/features for SSL as Oracle.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1135944569112521190-753137758684247021?l=databaseblog.myname.nl' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://databaseblog.myname.nl/feeds/753137758684247021/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://databaseblog.myname.nl/2011/03/using-ssl-with-mysql.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1135944569112521190/posts/default/753137758684247021'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1135944569112521190/posts/default/753137758684247021'/><link rel='alternate' type='text/html' href='http://databaseblog.myname.nl/2011/03/using-ssl-with-mysql.html' title='Using SSL with MySQL'/><author><name>Daniël van Eeden</name><uri>http://www.blogger.com/profile/14757324605223498151</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/-kM_1-DJNWjU/TfdkYXzFPbI/AAAAAAAAAA8/sBiPJeti0lI/s220/2011-06-11-145156-96.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1135944569112521190.post-295393965048790732</id><published>2011-03-04T14:54:00.001+01:00</published><updated>2011-04-12T14:17:17.519+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='rhel6'/><category scheme='http://www.blogger.com/atom/ns#' term='workbench'/><title type='text'>MySQL Workbench on RHEL6</title><content type='html'>Yesterday I &lt;a href="http://daniel-database.blogspot.com/2011/03/mysql-workbench-on-centos.html"&gt;blogged&lt;/a&gt; about some issues with MySQL Workbench. The problem was that CentOS 5.5 is not supported.&lt;br /&gt;&lt;br /&gt;So I installed RHEL6, one of the best known Enterprise Linux distributions. It's a 30 day evaluation, but that should be sufficient.&lt;br /&gt;&lt;br /&gt;After &lt;a href="http://www.virtualbox.org/ticket/5509"&gt;some&lt;/a&gt; &lt;a href="http://www.virtualbox.org/ticket/8490"&gt;minor&lt;/a&gt; &lt;a href="http://www.virtualbox.org/ticket/7776"&gt;issues&lt;/a&gt; with VirtualBox I had a working installation. So I tried to install MySQL Workbench again. I used 'sudo yum localinstall mysql-workbench-gpl-5.2.31a-2el6.x86_64.rpm' which failed because of 2 unmet dependencies: pexpect and libzip.so.1&lt;br /&gt;&lt;br /&gt;There is already a bug report in RHEL for the missing pexpect: &lt;a href="https://bugzilla.redhat.com/show_bug.cgi?id=652659"&gt;#&lt;/a&gt;&lt;a href="https://bugzilla.redhat.com/show_bug.cgi?id=652659"&gt;652659&lt;/a&gt;&lt;br /&gt;I used the RHEL6 installation DVD to install pexpect.&lt;br /&gt;&lt;br /&gt;There is a closed/wont-fix bug (&lt;a href="http://bugs.mysql.com/bug.php?id=54403"&gt;#54403&lt;/a&gt;) for the libzip.so.1 dependency. It turns out that libzip is in the "RHEL Server Optional" channel. RHN should be used to enable more channels, but apparently the optional channel is not part of the evaluation license, so I used the web interface to download and install the libzip RPM.&lt;br /&gt;&lt;br /&gt;The workbench installation finaly completed after complaining that the workbench rpm is not signed (use --nogpgcheck).&lt;br /&gt;&lt;br /&gt;So I started MySQL Workbench (There is a launcher in the menu). And then I clicked the "MySQL Doc Library" and Workbench responded with an error about a missing package: pysqlite2/python-sqlite2. I could find a python-sqite for RHEL5 on RHN... but nothing for RHEL6. So I filed &lt;a href="http://bugs.mysql.com/bug.php?id=60336"&gt;Bug #60336&lt;/a&gt;…&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1135944569112521190-295393965048790732?l=databaseblog.myname.nl' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://databaseblog.myname.nl/feeds/295393965048790732/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://databaseblog.myname.nl/2011/03/mysql-workbench-on-rhel6.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1135944569112521190/posts/default/295393965048790732'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1135944569112521190/posts/default/295393965048790732'/><link rel='alternate' type='text/html' href='http://databaseblog.myname.nl/2011/03/mysql-workbench-on-rhel6.html' title='MySQL Workbench on RHEL6'/><author><name>Daniël van Eeden</name><uri>http://www.blogger.com/profile/14757324605223498151</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/-kM_1-DJNWjU/TfdkYXzFPbI/AAAAAAAAAA8/sBiPJeti0lI/s220/2011-06-11-145156-96.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1135944569112521190.post-59027274853415883</id><published>2011-03-03T14:46:00.000+01:00</published><updated>2011-03-03T15:21:52.368+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='centos'/><category scheme='http://www.blogger.com/atom/ns#' term='myql'/><category scheme='http://www.blogger.com/atom/ns#' term='workbench'/><title type='text'>MySQL Workbench on CentOS</title><content type='html'>Every once in a while I use MySQL Workbench. First is was only for Windows, then it was unstable and now it is very well usable. Or at least that is the situation when you run on a recent Ubuntu machine.&lt;br /&gt;&lt;br /&gt;I'm now using CenOS 5.5 in a VirualBox VM to do some testing. Unfortunately the download site for MySQL Workbench has RPMs for RedHat 6 and Fedora Core 14 and some other platforms. No CentOS, No RHEL5, only the latest Fedora en RHEL.&lt;br /&gt;&lt;br /&gt;So I downloaded the RHEL6 RPMs and tried to install them with yum localinstall, but that failed. So they are not backwards compatible with 5.5.&lt;br /&gt;&lt;br /&gt;Turns out that CentOS/RHEL 5 doesn't have the required libraries to support MySQL Workbench.&lt;br /&gt;&lt;br /&gt;And unfortunately CentOS 5.5 is still the latest release. So an upgrade to CenOS 6 is not yet possible.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1135944569112521190-59027274853415883?l=databaseblog.myname.nl' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://databaseblog.myname.nl/feeds/59027274853415883/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://databaseblog.myname.nl/2011/03/mysql-workbench-on-centos.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1135944569112521190/posts/default/59027274853415883'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1135944569112521190/posts/default/59027274853415883'/><link rel='alternate' type='text/html' href='http://databaseblog.myname.nl/2011/03/mysql-workbench-on-centos.html' title='MySQL Workbench on CentOS'/><author><name>Daniël van Eeden</name><uri>http://www.blogger.com/profile/14757324605223498151</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/-kM_1-DJNWjU/TfdkYXzFPbI/AAAAAAAAAA8/sBiPJeti0lI/s220/2011-06-11-145156-96.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1135944569112521190.post-7763064388458214012</id><published>2009-07-06T12:14:00.002+02:00</published><updated>2011-04-29T15:09:47.818+02:00</updated><title type='text'>My MySQL wishlist (revised)</title><content type='html'>&lt;a href="http://daniel-database.blogspot.com/2007/11/my-mysql-wishlist.html"&gt;I wrote about my MySQL wishlist on November 14th 2007&lt;/a&gt; and now it's time for an update. I will copy-paste the old entry. The original text will be in italics.&lt;br /&gt;&lt;br /&gt;&lt;em&gt;1. Per user and/or per database quota&lt;br /&gt;Would very useful in setups for shared hosting. This would also prevent one database from bringing down the whole server. Separate tablespaces on different mountpoint can ease the pain, but I consider that a nasty hack.&lt;/em&gt;&lt;br /&gt;No update. Still problematic&lt;br /&gt;&lt;br /&gt;&lt;em&gt;2. External authentication&lt;br /&gt;I've seen numerous scripts which fetch the authentication info from ldap, a file, another database or some other authentication store. This should be integrated into mysql. The mysql grant tables should be pluggable so it is possible to write a custom authentication plugin. We already have plugable engines and function (UDF) so this shouldn't be that hard is it?&lt;/em&gt;&lt;br /&gt;No update. Still problematic&lt;br /&gt;&lt;br /&gt;&lt;em&gt;3. Database locator&lt;br /&gt;So you've got hundreds of servers.... and a multitude of databases. How to connect to the right server to reach the database you needed? Something like oracle TNS would be helpful here. What about implementing TNS for MySQL or just using DNS? How do you solve this?&lt;/em&gt;&lt;br /&gt;No update. Still problematic&lt;br /&gt;&lt;br /&gt;&lt;em&gt;4. Saving extra metadata about the database.&lt;br /&gt;A common way to store stuff like customerid, data classification, service classification (development, production, etc) would be helpful. Many people are already storing this info but there is no way MySQL Administrator, phpMyAdmin or other tools can use it.&lt;/em&gt;&lt;br /&gt;No update. Still problematic&lt;br /&gt;&lt;br /&gt;&lt;em&gt;5. better protection against run-away queries&lt;br /&gt;I would like to set max_query_time to 2 minutes.... but how?&lt;/em&gt;&lt;br /&gt;No update. Still problematic. There is a &lt;a href="http://dev.mysql.com/doc/refman/6.0/en/mysql-tips.html#safe-updates"&gt;safe-updates&lt;/a&gt; (a.k.a. i-am-a-dummy) option, but this doesn't fix it.&lt;br /&gt;&lt;br /&gt;&lt;em&gt;6. restore manager&lt;br /&gt;So you've created a backup using mysqldump for all databases and you've got your binlogs....it would be great if there was a tool which would filter one table or one database from your backup and replay the binlogs for that database. Somewhat like xfsrestore -i. I would call it the see-what-you've-got-and-pick-wha- you-like feature. Point in time recover is just too hard for many people starting with MySQL.&lt;/em&gt;&lt;br /&gt;No update. Still problematic, especially with multiple types of backups (dump, hot, NDB)&lt;br /&gt;&lt;br /&gt;7. SNMP for statistics&lt;br /&gt;Monitoring and statistics for many kinds of software and devices are using SNMP, but not for MySQL. Many people are using the MySQL protocol to fetch performance counters from their databases for cacti statistics. For some setups this will require many firewall and access list updates/changes while SNMP is already active.&lt;br /&gt;&lt;br /&gt;There is a software package which add this functionality to MySQL: &lt;a href="http://www.masterzen.fr/software-contributions/mysql-snmp-monitor-mysql-with-snmp/"&gt;mysql-snmp&lt;/a&gt;&lt;br /&gt;MySQL Enterprise does some SNMP, but I don't know the exact details&lt;br /&gt;&lt;br /&gt;8. SNMP for alerting&lt;br /&gt;Alert reporting to IBM Tivoli, HP OpenView and such requires scripting. How nice would it be to just load a MIB and set the snmp manager address and community and see the alerts coming in&lt;br /&gt;&lt;br /&gt;MySQL Enterprise does some SNMP, but I don't know the exact details&lt;br /&gt;&lt;br /&gt;8. Auditing&lt;br /&gt;For PCI, SOX404, HIPPA and other regulations auditing would be very helpfull. And ofcourse also for security forensics.&lt;br /&gt;There are some scripts and third-party applications which do basic auditing, mostly to verify secure installation. And&amp;nbsp;&lt;a href="http://forge.mysql.com/worklog/task.php?id=3771"&gt;Worklog #3771&lt;/a&gt;, &lt;a href="http://forge.mysql.com/worklog/task.php?id=1410"&gt;Worklog #1410&lt;/a&gt; and &lt;a href="http://forge.mysql.com/worklog/task.php?id=2878"&gt;Worklog #2878&lt;/a&gt; could bring a long-term solution. There are &lt;a href="http://dev.mysql.com/doc/refman/6.0/en/account-activity-auditing.html"&gt;guidelines for audit logging in applications&lt;/a&gt; available.&lt;br /&gt;&lt;br /&gt;Please let me know if there are any solutions or work-arounds&lt;br /&gt;&lt;br /&gt;Update 1: Yes, without maatkit this list would have been a bit longer :) it's also the default location to look for a work-around.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1135944569112521190-7763064388458214012?l=databaseblog.myname.nl' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://databaseblog.myname.nl/feeds/7763064388458214012/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://databaseblog.myname.nl/2009/07/my-mysql-wishlist-revised.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1135944569112521190/posts/default/7763064388458214012'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1135944569112521190/posts/default/7763064388458214012'/><link rel='alternate' type='text/html' href='http://databaseblog.myname.nl/2009/07/my-mysql-wishlist-revised.html' title='My MySQL wishlist (revised)'/><author><name>Daniël van Eeden</name><uri>http://www.blogger.com/profile/14757324605223498151</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/-kM_1-DJNWjU/TfdkYXzFPbI/AAAAAAAAAA8/sBiPJeti0lI/s220/2011-06-11-145156-96.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1135944569112521190.post-4503361725986265066</id><published>2009-06-30T13:13:00.001+02:00</published><updated>2011-04-29T13:14:31.562+02:00</updated><title type='text'>Another Crash in MySQL 5.0.22 on Ubuntu 6.06 LTS</title><content type='html'>1. Set this variable&lt;br /&gt;thread_stack = 265K&lt;br /&gt;&lt;br /&gt;2. Execute this query&lt;br /&gt;mysql&gt; SELECT 0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0&lt;br /&gt;+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+&lt;br /&gt;0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0&lt;br /&gt;+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+&lt;br /&gt;0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0&lt;br /&gt;+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+&lt;br /&gt;0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0&lt;br /&gt;+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+&lt;br /&gt;0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0&lt;br /&gt;+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+&lt;br /&gt;0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0&lt;br /&gt;+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+&lt;br /&gt;0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0&lt;br /&gt;+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+&lt;br /&gt;0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0&lt;br /&gt;+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+&lt;br /&gt;0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0&lt;br /&gt;+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+&lt;br /&gt;0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0&lt;br /&gt;+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0+0;&lt;br /&gt;&lt;br /&gt;3. And crash!&lt;br /&gt;ERROR 2013 (HY000): Lost connection to MySQL server during query&lt;br /&gt;&lt;br /&gt;It should've trown an error like this:&lt;br /&gt;ERROR 1436 (HY000): Thread stack overrun:  123072 bytes used of a 131072 byte stack, and 8192 bytes needed.  Use 'mysqld -O thread_stack=#' to specify a bigger stack.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1135944569112521190-4503361725986265066?l=databaseblog.myname.nl' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://databaseblog.myname.nl/feeds/4503361725986265066/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://databaseblog.myname.nl/2009/06/another-crash-in-mysql-5022-on-ubuntu.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1135944569112521190/posts/default/4503361725986265066'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1135944569112521190/posts/default/4503361725986265066'/><link rel='alternate' type='text/html' href='http://databaseblog.myname.nl/2009/06/another-crash-in-mysql-5022-on-ubuntu.html' title='Another Crash in MySQL 5.0.22 on Ubuntu 6.06 LTS'/><author><name>Daniël van Eeden</name><uri>http://www.blogger.com/profile/14757324605223498151</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/-kM_1-DJNWjU/TfdkYXzFPbI/AAAAAAAAAA8/sBiPJeti0lI/s220/2011-06-11-145156-96.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1135944569112521190.post-1150701385028119282</id><published>2009-06-30T12:17:00.000+02:00</published><updated>2011-04-29T12:17:54.483+02:00</updated><title type='text'>Using the MySQL Test Suite</title><content type='html'>Earlier I reported about two crashes related to MySQL 5.0.22 on Ubuntu 6.06 LTS.&lt;br /&gt;&lt;br /&gt;I think those bugs show a lack of testing on the side of Cannonical/Ubuntu. And for MySQL there is a quite good test suite available, so it's not rocketsience.&lt;br /&gt;&lt;br /&gt;There are multiple reasons why you could use the &lt;a href="http://dev.mysql.com/doc/mysqltest/en/index.html"&gt;MySQL Test Framework&lt;/a&gt;:&lt;br /&gt;1. Test if bug you previously experienced exists in the version you are using or planning to use.&lt;br /&gt;2. Test if configuration changes have a good or bad result on the stability of mysqld.&lt;br /&gt;3. Test if important functions still return the correct results (especially importand for financial systems)&lt;br /&gt;&lt;br /&gt;$ echo &amp;quot;SELECT @@version;&amp;quot; &amp;gt; version.test&lt;br /&gt;$ cp version.test version.result&lt;br /&gt;$ mysql &amp;lt; version.test &amp;gt;&amp;gt; version.result&lt;br /&gt;$ mysqltest --result-file=version.result --test-file=version.test&lt;br /&gt;ok&lt;br /&gt;$ cat version.result&lt;br /&gt;SELECT @@version;&lt;br /&gt;@@version&lt;br /&gt;5.0.81-1-log&lt;br /&gt;&lt;br /&gt;There is a utility for MySQL Cluster called &lt;a href="http://dev.mysql.com/doc/refman/5.1/en/mysql-cluster-programs-ndb-cpcd.html"&gt;ndb_cpcd&lt;/a&gt; which is a test utility for development. It controls processes and listens on a TCP port. Is has some overlap with the MySQL Instance Manager. But there is very few documentation available about it and I wonder if anyone is actually using this. And the other test utility for NDB is ndb_test_platform. I could not find any documentation about it ndb_test_platform, so i guess I'm not supposed to use it?&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1135944569112521190-1150701385028119282?l=databaseblog.myname.nl' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://databaseblog.myname.nl/feeds/1150701385028119282/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://databaseblog.myname.nl/2009/06/using-mysql-test-suite.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1135944569112521190/posts/default/1150701385028119282'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1135944569112521190/posts/default/1150701385028119282'/><link rel='alternate' type='text/html' href='http://databaseblog.myname.nl/2009/06/using-mysql-test-suite.html' title='Using the MySQL Test Suite'/><author><name>Daniël van Eeden</name><uri>http://www.blogger.com/profile/14757324605223498151</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/-kM_1-DJNWjU/TfdkYXzFPbI/AAAAAAAAAA8/sBiPJeti0lI/s220/2011-06-11-145156-96.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1135944569112521190.post-1759906833066165108</id><published>2009-06-29T13:15:00.001+02:00</published><updated>2011-04-29T13:16:17.236+02:00</updated><title type='text'>Crash in MySQL 5.0.22 on Ubuntu 6.06 LTS</title><content type='html'>I found a new crasher in the MySQL 5.0 version which ships with Ubuntu 6.06 LTS.&lt;br /&gt;&lt;br /&gt;&lt;tt&gt;&amp;gt; SELECT * FROM (SELECT mu.User FROM mysql.user mu UNION SELECT mu.user FROM mysql.user mu ORDER BY mu.user) a;&lt;br /&gt;ERROR 2013 (HY000): Lost connection to MySQL server during query&lt;/tt&gt;&lt;br /&gt;&lt;br /&gt;The bug report: &lt;a href="https://bugs.launchpad.net/ubuntu/+source/mysql-dfsg-5.0/+bug/392236"&gt;LP392236&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;On MySQL 5.0.51 on Debian stable it returns this error (like it should):&lt;br /&gt;&lt;tt&gt;ERROR 1054 (42S22): Unknown column 'mu.user' in 'order clause'&lt;/tt&gt;&lt;br /&gt;&lt;br /&gt;The correct query should be like this (Using culumn a number):&lt;br /&gt;&lt;tt&gt;&amp;gt; SELECT * FROM (SELECT mu.User FROM mysql.user mu UNION SELECT mu.user FROM mysql.user mu ORDER BY 1) a;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1135944569112521190-1759906833066165108?l=databaseblog.myname.nl' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://databaseblog.myname.nl/feeds/1759906833066165108/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://databaseblog.myname.nl/2009/06/crash-in-mysql-5022-on-ubuntu-606-lts.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1135944569112521190/posts/default/1759906833066165108'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1135944569112521190/posts/default/1759906833066165108'/><link rel='alternate' type='text/html' href='http://databaseblog.myname.nl/2009/06/crash-in-mysql-5022-on-ubuntu-606-lts.html' title='Crash in MySQL 5.0.22 on Ubuntu 6.06 LTS'/><author><name>Daniël van Eeden</name><uri>http://www.blogger.com/profile/14757324605223498151</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/-kM_1-DJNWjU/TfdkYXzFPbI/AAAAAAAAAA8/sBiPJeti0lI/s220/2011-06-11-145156-96.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1135944569112521190.post-3836030009976512076</id><published>2007-11-14T12:08:00.002+01:00</published><updated>2011-04-29T12:13:04.518+02:00</updated><title type='text'>My MySQL wishlist</title><content type='html'>This is my personal whishlist for MySQL. &lt;br /&gt;&lt;br /&gt;Please let me know if I'm wrong or if there is a workaround for any of these items.&lt;br /&gt;&lt;br /&gt;1. Per user and/or per database quota&lt;br /&gt;Would very useful in setups for shared hosting. This would also prevent one database from bringing down the whole server. Separate tablespaces on different mountpoint can ease the pain, but I consider that a nasty hack.&lt;br /&gt;&lt;br /&gt;2. External authentication&lt;br /&gt;I've seen numerous scripts which fetch the authentication info from ldap, a file, another database or some other authentication store. This should be integrated into mysql. The mysql grant tables should be pluggable so it is possible to write a custom authentication plugin. We already have plugable engines and function (UDF) so this shouldn't be that hard is it?&lt;br /&gt;&lt;br /&gt;3. Database locator&lt;br /&gt;So you've got hundreds of servers.... and a multitude of databases. How to connect to the right server to reach the database you needed? Something like oracle TNS would be helpful here. What about implementing TNS for MySQL or just using DNS? How do you solve this?&lt;br /&gt;&lt;br /&gt;4. Saving extra metadata about the database.&lt;br /&gt;A common way to store stuff like customerid, data classification, service classification (development, production, etc) would be helpful. Many people are already storing this info but there is no way MySQL Administrator, phpMyAdmin or other tools can use it.&lt;br /&gt;&lt;br /&gt;5. better protection against run-away queries&lt;br /&gt;I would like to set max_query_time to 2 minutes.... but how?&lt;br /&gt;&lt;br /&gt;6. restore manager&lt;br /&gt;So you've created a backup using mysqldump for all databases and you've got your binlogs....it would be great if there was a tool which would filter one table or one database from your backup and replay the binlogs for that database. Somewhat like xfsrestore -i. I would call it the see-what-you've-got-and-pick-wha- you-like feature. Point in time recover is just too hard for many people starting with MySQL.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1135944569112521190-3836030009976512076?l=databaseblog.myname.nl' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://databaseblog.myname.nl/feeds/3836030009976512076/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://databaseblog.myname.nl/2007/11/my-mysql-wishlist.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1135944569112521190/posts/default/3836030009976512076'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1135944569112521190/posts/default/3836030009976512076'/><link rel='alternate' type='text/html' href='http://databaseblog.myname.nl/2007/11/my-mysql-wishlist.html' title='My MySQL wishlist'/><author><name>Daniël van Eeden</name><uri>http://www.blogger.com/profile/14757324605223498151</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://4.bp.blogspot.com/-kM_1-DJNWjU/TfdkYXzFPbI/AAAAAAAAAA8/sBiPJeti0lI/s220/2011-06-11-145156-96.jpg'/></author><thr:total>0</thr:total></entry></feed>
