Home > mysql > Restoring readline capabilities of Ubuntu’s 9.10 (Karmic Koala) MySQL client

Restoring readline capabilities of Ubuntu’s 9.10 (Karmic Koala) MySQL client

December 24th, 2009 pablo Leave a comment Go to comments

I recently updated to the newest version, 9.10 AKA Karmic Koala and I love it. It’s fast and everything works perfectly. Or nearly everything…

The one thing that really annoyed me in this version was the MySQL terminal. All of a sudden after the upgrade ctrl+r for reverse search didn’t work anymore. And there was more…delete didn’t work either and esc+backspace was behaving weirdly too. Unfortunately I did not have time to look for a solution because of my work load. But then xmas came and here I am, stuck at home with the family, giving me a lot of time to research about those things that were very low on my priorities list. And I found a solution!

It seems that Ubuntu replaced libreadline with libedit. And readline is the library that provides all those cool command line capabilities. So let’s enable it again, but instead of compiling the whole thing again, let’s just use a wrapper, the readline wrapper!

First, let’s install it:

sudo apt-get install rlwrap

That’s it! Now all we need to do is to start mysql command line interface through rlwrap:

rlwrap -a mysql -uUSER -pPASSWORD DBNAME

To make things easier, let’s create an alias in our bashrc file.

vi ~/.bashrc

And add the alias:

alias mysql='rlwrap -a mysql'

Credit: http://ubuntuforums.org/showthread.php?t=1147183

http://blog.melimato.com/wp-content/plugins/sociofluid/images/digg_24.png http://blog.melimato.com/wp-content/plugins/sociofluid/images/reddit_24.png http://blog.melimato.com/wp-content/plugins/sociofluid/images/stumbleupon_24.png http://blog.melimato.com/wp-content/plugins/sociofluid/images/delicious_24.png http://blog.melimato.com/wp-content/plugins/sociofluid/images/technorati_24.png http://blog.melimato.com/wp-content/plugins/sociofluid/images/google_24.png http://blog.melimato.com/wp-content/plugins/sociofluid/images/myspace_24.png http://blog.melimato.com/wp-content/plugins/sociofluid/images/facebook_24.png http://blog.melimato.com/wp-content/plugins/sociofluid/images/yahoobuzz_24.png http://blog.melimato.com/wp-content/plugins/sociofluid/images/twitter_24.png http://blog.melimato.com/wp-content/plugins/sociofluid/images/meneame_24.png
Categories: mysql Tags: , , ,
  1. Srinivas
    January 12th, 2010 at 13:28 | #1

    I am also facing the same problem after upgrading to ubuntu karmic. I am unable to resolve it using ur method. Thank you very much.

  2. Srinivas
    January 12th, 2010 at 13:43 | #2

    Hi, I am however facing a problem. When I am doing reverse search using (ctrl R), “use40TagData;” I am getting a 40 in the history item instead of space. I have enable UTF-8 encoding in mysql. Is it due to that.

  3. rado
    January 25th, 2010 at 19:50 | #3

    If you use an interactive pager such as less, then this doesn’t work as the less commands are then intercepted by rlwrap

  1. No trackbacks yet.

Comment moderation is enabled. Your comment may take some time to appear.

Additional comments powered by BackType