Restoring readline capabilities of Ubuntu’s 9.10 (Karmic Koala) MySQL client
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'











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.
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.
If you use an interactive pager such as less, then this doesn’t work as the less commands are then intercepted by rlwrap