<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Db on Amit Agarwal Linux Blog</title>
    <link>/tags/db/</link>
    <description>Recent content in Db on Amit Agarwal Linux Blog</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en</language>
    <lastBuildDate>Thu, 04 Feb 2010 15:58:37 +0000</lastBuildDate>
    
	<atom:link href="/tags/db/index.xml" rel="self" type="application/rss+xml" />
    
    
    <item>
      <title>Execute mysql command from shell</title>
      <link>/2010/02/04/execute-mysql-command-from-shell/</link>
      <pubDate>Thu, 04 Feb 2010 15:58:37 +0000</pubDate>
      
      <guid>/2010/02/04/execute-mysql-command-from-shell/</guid>
      <description>&lt;!--[ad#ad-2]--&gt;
&lt;p&gt;phpMyAdmin is a very slow application if you want to execute a query on your database. If you know the name of the database then any GUI tool is an overhead. So I have written a one liner shell script to do that for me 🙂&lt;/p&gt;
&lt;p&gt;Here&amp;amp;#8217;s the script:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;echo &amp;amp;#8221;select * from table where field like &amp;amp;#8221;%$1%&amp;amp;#8221;&amp;amp;#8221;|mysql -h doamin.com -u amit -p -D amit -r –password=hello&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;When run with one argument it will execute the sql query directly without asking for password also.&lt;/p&gt;</description>
    </item>
    
  </channel>
</rss>
