Sunday, October 4, 2015

Pretty MySQL

Recently MySql became a regular part of my day job.
As with other I struggled with reading wide tables on the console.

Quick tips for developers try the following:

1.  Enabling vertical mode, using "\G" to execute the query instead of ";", i.e. mysql> SELECT * FROM sometable \G

2. Enable less pager with nowrap option
mysql> pager less -SFX
mysql> SELECT * FROM sometable;
This will pipe the outut through the less command line tool which - with these parameters - will give you a tabular output that can be scrolled horizontally and vertically with the cursor keys.


Trust me #2 is a winner.
Try and see for yourself.

My my maria

All you mysql users must never have wondered why MySql was called so. 
Well, its my sql server so MySql. 
Correct? 
No!

Turns out it was named so, after the first daughter of MySql founder Michael Monty Widenius, named "My".
What!
That is correct. 



A short history lesson. MySQL was acquired for $1bn by Sun Microsystems in 2008'ish, which in turn was bought by Oracle for $7.4bn in 2010. In fact, the day Oracle announced the purchase of Sun, Michael Monty Widenius forked MySQL, launching MariaDB, and took a swath of MySQL developers with him. According to Monty’s own words at a MySQL & MariaDB conference in Santa Clara on April 2014, MariaDB was born to ensure that a free version of MySQL always exists.
Now who's Maria?You guessed it. His other daughter.

Ever heard about MaxDB?