<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Blog dot Melimato dot Com &#187; mysql command line</title>
	<atom:link href="http://blog.melimato.com/tag/mysql-command-line/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.melimato.com</link>
	<description>Those things we do</description>
	<lastBuildDate>Thu, 24 Dec 2009 11:58:58 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=abc</generator>
		<item>
		<title>Restoring readline capabilities of Ubuntu&#8217;s 9.10 (Karmic Koala) MySQL client</title>
		<link>http://blog.melimato.com/restoring-readline-capabilities-of-ubuntus-9-10-karmic-koala-mysql-client/</link>
		<comments>http://blog.melimato.com/restoring-readline-capabilities-of-ubuntus-9-10-karmic-koala-mysql-client/#comments</comments>
		<pubDate>Thu, 24 Dec 2009 11:58:58 +0000</pubDate>
		<dc:creator>pablo</dc:creator>
				<category><![CDATA[mysql]]></category>
		<category><![CDATA[mysql command line]]></category>
		<category><![CDATA[readline]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://blog.melimato.com/?p=227</guid>
		<description><![CDATA[I recently updated to the newest version, 9.10 AKA Karmic Koala and I love it. It&#8217;s fast and everything works perfectly. Or nearly everything&#8230; 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&#8217;t work anymore. And there was [...]]]></description>
			<content:encoded><![CDATA[<p>I recently updated to the <a href="http://www.ubuntu.com/">newest version, 9.10 AKA Karmic Koala</a> and I love it. It&#8217;s fast and everything works perfectly. Or nearly everything&#8230;</p>
<p><span id="more-227"></span></p>
<p>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&#8217;t work anymore. And there was more&#8230;delete didn&#8217;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!</p>
<p>It seems that Ubuntu replaced <a href="http://utopia.knoware.nl/~hlub/uck/rlwrap/">libreadline</a> with <a href="http://thrysoee.dk/editline/">libedit</a>. And <a href="http://utopia.knoware.nl/~hlub/uck/rlwrap/">readline</a> is the library that provides all those cool command line capabilities. So let&#8217;s enable it again, but instead of compiling the whole thing again, let&#8217;s just use a wrapper, the <a href="http://freshmeat.net/projects/rlwrap/">readline wrapper</a>!</p>
<p>First, let&#8217;s install it:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> rlwrap</pre></div></div>

<p>That&#8217;s it! Now all we need to do is to start mysql command line interface through rlwrap:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">rlwrap <span style="color: #660033;">-a</span> mysql <span style="color: #660033;">-uUSER</span> <span style="color: #660033;">-pPASSWORD</span> DBNAME</pre></div></div>

<p>To make things easier, let&#8217;s create an alias in our bashrc file.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">vi</span> ~<span style="color: #000000; font-weight: bold;">/</span>.bashrc</pre></div></div>

<p>And add the alias:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">alias</span> <span style="color: #007800;">mysql</span>=<span style="color: #ff0000;">'rlwrap -a mysql'</span></pre></div></div>

<p>Credit: <a href="http://ubuntuforums.org/showthread.php?t=1147183">http://ubuntuforums.org/showthread.php?t=1147183</a></p>
<div id="wherego_related"> </div>]]></content:encoded>
			<wfw:commentRss>http://blog.melimato.com/restoring-readline-capabilities-of-ubuntus-9-10-karmic-koala-mysql-client/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
