<?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>satishgaudo.com &#187; Mysql</title>
	<atom:link href="http://satishgaudo.com/satblog/category/mysql/feed/" rel="self" type="application/rss+xml" />
	<link>http://satishgaudo.com/satblog</link>
	<description>Understanding technology</description>
	<lastBuildDate>Sat, 19 Nov 2011 08:13:49 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Linux command to check the number connections to mysql server</title>
		<link>http://satishgaudo.com/satblog/2010/10/29/linux-command-to-check-the-number-connections-to-mysql-server/</link>
		<comments>http://satishgaudo.com/satblog/2010/10/29/linux-command-to-check-the-number-connections-to-mysql-server/#comments</comments>
		<pubDate>Fri, 29 Oct 2010 12:10:57 +0000</pubDate>
		<dc:creator>satishgaudo</dc:creator>
				<category><![CDATA[Mysql]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[check number of connections to mysql]]></category>
		<category><![CDATA[nestat]]></category>

		<guid isPermaLink="false">http://satishgaudo.com/satblog/?p=272</guid>
		<description><![CDATA[
			
				
			
		
///check the number of connections to database
netstat -antp &#124; grep :3306 &#124; wc -l
]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fsatishgaudo.com%2Fsatblog%2F2010%2F10%2F29%2Flinux-command-to-check-the-number-connections-to-mysql-server%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fsatishgaudo.com%2Fsatblog%2F2010%2F10%2F29%2Flinux-command-to-check-the-number-connections-to-mysql-server%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>///check the number of connections to database<br />
netstat -antp | grep :3306 | wc -l</p>
]]></content:encoded>
			<wfw:commentRss>http://satishgaudo.com/satblog/2010/10/29/linux-command-to-check-the-number-connections-to-mysql-server/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>HAVING Clause</title>
		<link>http://satishgaudo.com/satblog/2010/04/26/having-clause/</link>
		<comments>http://satishgaudo.com/satblog/2010/04/26/having-clause/#comments</comments>
		<pubDate>Mon, 26 Apr 2010 09:01:18 +0000</pubDate>
		<dc:creator>satishgaudo</dc:creator>
				<category><![CDATA[Mysql]]></category>

		<guid isPermaLink="false">http://satishgaudo.com/satblog/2010/04/26/having-clause/</guid>
		<description><![CDATA[
			
				
			
		
The HAVING clause was added to SQL because the WHERE clause could not be used with aggregate functions.
Syntax:
SELECT column_name, aggregate_function(column_name)
FROM table_name
WHERE column_name operator value
GROUP BY column_name
HAVING aggregate_function(column_name) operator value
Example:
SELECT customer,SUM(orderprice) FROM trans_orders
GROUP BY customer
HAVING SUM(orderprice)]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fsatishgaudo.com%2Fsatblog%2F2010%2F04%2F26%2Fhaving-clause%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fsatishgaudo.com%2Fsatblog%2F2010%2F04%2F26%2Fhaving-clause%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>The HAVING clause was added to SQL because the WHERE clause could not be used with aggregate functions.</p>
<p>Syntax:</p>
<p>SELECT column_name, aggregate_function(column_name)<br />
FROM table_name<br />
WHERE column_name operator value<br />
GROUP BY column_name<br />
HAVING aggregate_function(column_name) operator value</p>
<p>Example:<br />
SELECT customer,SUM(orderprice) FROM trans_orders<br />
GROUP BY customer<br />
HAVING SUM(orderprice)<1000</p>
]]></content:encoded>
			<wfw:commentRss>http://satishgaudo.com/satblog/2010/04/26/having-clause/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>ALTER TABLE for table indexing:Example</title>
		<link>http://satishgaudo.com/satblog/2010/04/13/alter-table-for-table-indexingexample/</link>
		<comments>http://satishgaudo.com/satblog/2010/04/13/alter-table-for-table-indexingexample/#comments</comments>
		<pubDate>Tue, 13 Apr 2010 11:25:30 +0000</pubDate>
		<dc:creator>satishgaudo</dc:creator>
				<category><![CDATA[Mysql]]></category>
		<category><![CDATA[mysql table indexing]]></category>

		<guid isPermaLink="false">http://satishgaudo.com/satblog/?p=167</guid>
		<description><![CDATA[
			
				
			
		
ALTER TABLE `listing` ADD INDEX `idx_uid_type` ( `uid` , `listing_type` ) ;
ALTER TABLE `users` ADD INDEX ( `email` ) ;
ALTER TABLE `listing_reply` ADD INDEX ( `listingid` , `uid` , `parent_listing` ) ;
]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fsatishgaudo.com%2Fsatblog%2F2010%2F04%2F13%2Falter-table-for-table-indexingexample%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fsatishgaudo.com%2Fsatblog%2F2010%2F04%2F13%2Falter-table-for-table-indexingexample%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>ALTER TABLE `listing` ADD INDEX `idx_uid_type` ( `uid` , `listing_type` ) ;<br />
ALTER TABLE `users` ADD INDEX ( `email` ) ;</p>
<p>ALTER TABLE `listing_reply` ADD INDEX ( `listingid` , `uid` , `parent_listing` ) ;</p>
]]></content:encoded>
			<wfw:commentRss>http://satishgaudo.com/satblog/2010/04/13/alter-table-for-table-indexingexample/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Export the query result in a temporary file</title>
		<link>http://satishgaudo.com/satblog/2010/01/20/export-the-query-result-in-a-temporary-file/</link>
		<comments>http://satishgaudo.com/satblog/2010/01/20/export-the-query-result-in-a-temporary-file/#comments</comments>
		<pubDate>Wed, 20 Jan 2010 09:16:51 +0000</pubDate>
		<dc:creator>satishgaudo</dc:creator>
				<category><![CDATA[Mysql]]></category>

		<guid isPermaLink="false">http://satishgaudo.com/satblog/?p=134</guid>
		<description><![CDATA[
			
				
			
		
select video_file from videos INTO OUTFILE &#8216;/tmp/video1.txt&#8217;;
Query Above exports all the rows for coulmn video_file into a text file &#8220;/tmp/video1.txt&#8221; . 
]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fsatishgaudo.com%2Fsatblog%2F2010%2F01%2F20%2Fexport-the-query-result-in-a-temporary-file%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fsatishgaudo.com%2Fsatblog%2F2010%2F01%2F20%2Fexport-the-query-result-in-a-temporary-file%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>select video_file from videos INTO OUTFILE &#8216;/tmp/video1.txt&#8217;;</p>
<p>Query Above exports all the rows for coulmn video_file into a text file &#8220;/tmp/video1.txt&#8221; . </p>
]]></content:encoded>
			<wfw:commentRss>http://satishgaudo.com/satblog/2010/01/20/export-the-query-result-in-a-temporary-file/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>shell script to optimize database</title>
		<link>http://satishgaudo.com/satblog/2009/10/27/shell-script-to-optimize-database/</link>
		<comments>http://satishgaudo.com/satblog/2009/10/27/shell-script-to-optimize-database/#comments</comments>
		<pubDate>Tue, 27 Oct 2009 06:57:24 +0000</pubDate>
		<dc:creator>satishgaudo</dc:creator>
				<category><![CDATA[Mysql]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://satishgaudo.com/satblog/?p=122</guid>
		<description><![CDATA[
			
				
			
		
DB_LIST=&#8221;$(mysql -u root  -Bse &#8217;show databases&#8217; &#124; egrep -v &#8216;information_schema&#124;mysql&#124;test&#8217;)&#8221;
for db in ${DB_LIST[@]}
do
TABLENAMES=&#8221;$(mysql -u root  $db -Bse &#8217;show tables&#8217;)&#8221;
echo &#8220;Database: &#8220;$db
for TABLENAME in ${TABLENAMES[@]}
do
mysql -u root $db -Bse &#8220;optimize TABLE $TABLENAME;&#8221;
echo $TABLENAME&#8221; table has been optimized&#8221;
done
echo $db &#8211; $TABLENAME &#8220;Optimized has been completed&#8221;
done
echo &#8220;All Databases have been successfully Optimized&#8221;
]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fsatishgaudo.com%2Fsatblog%2F2009%2F10%2F27%2Fshell-script-to-optimize-database%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fsatishgaudo.com%2Fsatblog%2F2009%2F10%2F27%2Fshell-script-to-optimize-database%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>DB_LIST=&#8221;$(mysql -u root  -Bse &#8217;show databases&#8217; | egrep -v &#8216;information_schema|mysql|test&#8217;)&#8221;<br />
for db in ${DB_LIST[@]}<br />
do<br />
TABLENAMES=&#8221;$(mysql -u root  $db -Bse &#8217;show tables&#8217;)&#8221;<br />
echo &#8220;Database: &#8220;$db<br />
for TABLENAME in ${TABLENAMES[@]}<br />
do<br />
mysql -u root $db -Bse &#8220;optimize TABLE $TABLENAME;&#8221;<br />
echo $TABLENAME&#8221; table has been optimized&#8221;<br />
done<br />
echo $db &#8211; $TABLENAME &#8220;Optimized has been completed&#8221;<br />
done<br />
echo &#8220;All Databases have been successfully Optimized&#8221;</p>
]]></content:encoded>
			<wfw:commentRss>http://satishgaudo.com/satblog/2009/10/27/shell-script-to-optimize-database/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>shell script to Analyze database</title>
		<link>http://satishgaudo.com/satblog/2009/10/27/shell-script-to-analyze-database/</link>
		<comments>http://satishgaudo.com/satblog/2009/10/27/shell-script-to-analyze-database/#comments</comments>
		<pubDate>Tue, 27 Oct 2009 06:56:21 +0000</pubDate>
		<dc:creator>satishgaudo</dc:creator>
				<category><![CDATA[Mysql]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://satishgaudo.com/satblog/?p=120</guid>
		<description><![CDATA[
			
				
			
		
DB_LIST=&#8221;$(mysql -u root  -Bse &#8217;show databases&#8217; &#124; egrep -v &#8216;information_schema&#124;mysql&#124;test&#8217;)&#8221;
for db in ${DB_LIST[@]}
do
TABLENAMES=&#8221;$(mysql -u root   $db -Bse &#8217;show tables&#8217;)&#8221;
echo &#8220;Database: &#8220;$db
for TABLENAME in ${TABLENAMES[@]}
do
mysql -u root $db -Bse &#8220;Analyze TABLE $TABLENAME;&#8221;
echo $TABLENAME &#8220;Analyze has been done&#8221;
done
echo $db &#8211; $TABLENAME &#8220;Analyzis has been completed&#8221;
done
echo &#8220;All Databases have been successfully Optimized&#8221;
]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fsatishgaudo.com%2Fsatblog%2F2009%2F10%2F27%2Fshell-script-to-analyze-database%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fsatishgaudo.com%2Fsatblog%2F2009%2F10%2F27%2Fshell-script-to-analyze-database%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>DB_LIST=&#8221;$(mysql -u root  -Bse &#8217;show databases&#8217; | egrep -v &#8216;information_schema|mysql|test&#8217;)&#8221;<br />
for db in ${DB_LIST[@]}<br />
do<br />
TABLENAMES=&#8221;$(mysql -u root   $db -Bse &#8217;show tables&#8217;)&#8221;<br />
echo &#8220;Database: &#8220;$db<br />
for TABLENAME in ${TABLENAMES[@]}<br />
do<br />
mysql -u root $db -Bse &#8220;Analyze TABLE $TABLENAME;&#8221;<br />
echo $TABLENAME &#8220;Analyze has been done&#8221;<br />
done<br />
echo $db &#8211; $TABLENAME &#8220;Analyzis has been completed&#8221;<br />
done<br />
echo &#8220;All Databases have been successfully Optimized&#8221;</p>
]]></content:encoded>
			<wfw:commentRss>http://satishgaudo.com/satblog/2009/10/27/shell-script-to-analyze-database/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

