<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: MyDumpSplitter-Extract tables from Mysql dump-shell script</title>
	<atom:link href="http://kedar.nitty-witty.com/blog/mydumpsplitter-extract-tables-from-mysql-dump-shell-script/feed" rel="self" type="application/rss+xml" />
	<link>http://kedar.nitty-witty.com/blog/mydumpsplitter-extract-tables-from-mysql-dump-shell-script</link>
	<description>Kedar&#039;s Blog for MySQL and more</description>
	<lastBuildDate>Fri, 27 Jan 2012 04:35:06 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>By: Kedar</title>
		<link>http://kedar.nitty-witty.com/blog/mydumpsplitter-extract-tables-from-mysql-dump-shell-script/comment-page-3#comment-3421</link>
		<dc:creator>Kedar</dc:creator>
		<pubDate>Thu, 17 Nov 2011 13:15:21 +0000</pubDate>
		<guid isPermaLink="false">http://kedar.nitty-witty.com/blog/?p=523#comment-3421</guid>
		<description>Hi Alex,

Thanks for posting here.
Well I tested the script for the said scenario &quot;fetching the last table&quot;: 

sh  mysqldumpsplitter.sh  SQL-FILE  LAST-TABLE-NAME

and it worked fine for me.
Can you tell me your exact scenario?

Thanks,
Kedar.</description>
		<content:encoded><![CDATA[<p>Hi Alex,</p>
<p>Thanks for posting here.<br />
Well I tested the script for the said scenario &#8220;fetching the last table&#8221;: </p>
<p>sh  mysqldumpsplitter.sh  SQL-FILE  LAST-TABLE-NAME</p>
<p>and it worked fine for me.<br />
Can you tell me your exact scenario?</p>
<p>Thanks,<br />
Kedar.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: alex</title>
		<link>http://kedar.nitty-witty.com/blog/mydumpsplitter-extract-tables-from-mysql-dump-shell-script/comment-page-3#comment-3418</link>
		<dc:creator>alex</dc:creator>
		<pubDate>Thu, 17 Nov 2011 02:56:05 +0000</pubDate>
		<guid isPermaLink="false">http://kedar.nitty-witty.com/blog/?p=523#comment-3418</guid>
		<description>here is a bug!
when i want to extract table which locate in the last of dump file.I get error like this:
   ERROR 1231 (42000) at line 25: Variable &#039;time_zone&#039; can&#039;t be   set to the value of &#039;NULL&#039;
Reason:extract extra infomation as follows:
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;</description>
		<content:encoded><![CDATA[<p>here is a bug!<br />
when i want to extract table which locate in the last of dump file.I get error like this:<br />
   ERROR 1231 (42000) at line 25: Variable &#8216;time_zone&#8217; can&#8217;t be   set to the value of &#8216;NULL&#8217;<br />
Reason:extract extra infomation as follows:<br />
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;</p>
<p>/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;<br />
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;<br />
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;<br />
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;<br />
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;<br />
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;<br />
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: abdussamad</title>
		<link>http://kedar.nitty-witty.com/blog/mydumpsplitter-extract-tables-from-mysql-dump-shell-script/comment-page-1#comment-3385</link>
		<dc:creator>abdussamad</dc:creator>
		<pubDate>Tue, 01 Nov 2011 14:25:58 +0000</pubDate>
		<guid isPermaLink="false">http://kedar.nitty-witty.com/blog/?p=523#comment-3385</guid>
		<description>Thank you! It works great. Exactly what I was looking for!</description>
		<content:encoded><![CDATA[<p>Thank you! It works great. Exactly what I was looking for!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: me</title>
		<link>http://kedar.nitty-witty.com/blog/mydumpsplitter-extract-tables-from-mysql-dump-shell-script/comment-page-3#comment-3368</link>
		<dc:creator>me</dc:creator>
		<pubDate>Wed, 19 Oct 2011 09:27:26 +0000</pubDate>
		<guid isPermaLink="false">http://kedar.nitty-witty.com/blog/?p=523#comment-3368</guid>
		<description>Thanks a lot for the script! It was very helpfully for me!</description>
		<content:encoded><![CDATA[<p>Thanks a lot for the script! It was very helpfully for me!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mydumpsplitter-Extract Tables From Mysql Dump-Shell Script &#124; ishtiyaq.com</title>
		<link>http://kedar.nitty-witty.com/blog/mydumpsplitter-extract-tables-from-mysql-dump-shell-script/comment-page-3#comment-3365</link>
		<dc:creator>Mydumpsplitter-Extract Tables From Mysql Dump-Shell Script &#124; ishtiyaq.com</dc:creator>
		<pubDate>Fri, 07 Oct 2011 15:07:16 +0000</pubDate>
		<guid isPermaLink="false">http://kedar.nitty-witty.com/blog/?p=523#comment-3365</guid>
		<description>[...] To see original posting on my blog: http://kedar.nitty-witty.com/blog/mydumpsplitter-extract-tables-from-mysql-dump-shell-script/ [...]</description>
		<content:encoded><![CDATA[<p>[...] To see original posting on my blog: http://kedar.nitty-witty.com/blog/mydumpsplitter-extract-tables-from-mysql-dump-shell-script/ [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kedar</title>
		<link>http://kedar.nitty-witty.com/blog/mydumpsplitter-extract-tables-from-mysql-dump-shell-script/comment-page-3#comment-3338</link>
		<dc:creator>Kedar</dc:creator>
		<pubDate>Tue, 04 Oct 2011 07:49:22 +0000</pubDate>
		<guid isPermaLink="false">http://kedar.nitty-witty.com/blog/?p=523#comment-3338</guid>
		<description>Let me know how may i help you.</description>
		<content:encoded><![CDATA[<p>Let me know how may i help you.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Vertejas</title>
		<link>http://kedar.nitty-witty.com/blog/mydumpsplitter-extract-tables-from-mysql-dump-shell-script/comment-page-3#comment-3337</link>
		<dc:creator>Vertejas</dc:creator>
		<pubDate>Tue, 04 Oct 2011 07:42:15 +0000</pubDate>
		<guid isPermaLink="false">http://kedar.nitty-witty.com/blog/?p=523#comment-3337</guid>
		<description>I don&#039;t know what to do, by my is something timeout error...</description>
		<content:encoded><![CDATA[<p>I don&#8217;t know what to do, by my is something timeout error&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Information Systems Talk &#187; Mydumpsplitter-Extract Tables From Mysql Dump-Shell Script</title>
		<link>http://kedar.nitty-witty.com/blog/mydumpsplitter-extract-tables-from-mysql-dump-shell-script/comment-page-2#comment-3308</link>
		<dc:creator>Information Systems Talk &#187; Mydumpsplitter-Extract Tables From Mysql Dump-Shell Script</dc:creator>
		<pubDate>Sat, 10 Sep 2011 07:16:46 +0000</pubDate>
		<guid isPermaLink="false">http://kedar.nitty-witty.com/blog/?p=523#comment-3308</guid>
		<description>[...] To see original posting on my blog: http://kedar.nitty-witty.com/blog/mydumpsplitter-extract-tables-from-mysql-dump-shell-script/ [...]</description>
		<content:encoded><![CDATA[<p>[...] To see original posting on my blog: http://kedar.nitty-witty.com/blog/mydumpsplitter-extract-tables-from-mysql-dump-shell-script/ [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eirron</title>
		<link>http://kedar.nitty-witty.com/blog/mydumpsplitter-extract-tables-from-mysql-dump-shell-script/comment-page-2#comment-3285</link>
		<dc:creator>Eirron</dc:creator>
		<pubDate>Tue, 16 Aug 2011 20:00:34 +0000</pubDate>
		<guid isPermaLink="false">http://kedar.nitty-witty.com/blog/?p=523#comment-3285</guid>
		<description>Came across your script.  nice work.

Thought I&#039;d pass this helpful tip to those who&#039;s *.sql files are stored/saved as *.sql.gz (compressed) files.

To avoid having to uncompress a full backup dump first (especially if its very large; and disk space is a premium).. I may the following minor code mods..

change all grep cmds to zgrep

change all lines 
  sed -n &quot;/^-- Table structure for table \`$tablename\`/,/^-- Table structure for table/p&quot; $1 &gt; $TARGET_DIR/$tablename.sql
to
  zcat $1 &#124; sed -n &quot;/^-- Table structure for table \`$tablename\`/,/^-- Table structure for table/p&quot; &gt;$TARGET_DIR/$tablename.sql</description>
		<content:encoded><![CDATA[<p>Came across your script.  nice work.</p>
<p>Thought I&#8217;d pass this helpful tip to those who&#8217;s *.sql files are stored/saved as *.sql.gz (compressed) files.</p>
<p>To avoid having to uncompress a full backup dump first (especially if its very large; and disk space is a premium).. I may the following minor code mods..</p>
<p>change all grep cmds to zgrep</p>
<p>change all lines<br />
  sed -n &#8220;/^&#8211; Table structure for table \`$tablename\`/,/^&#8211; Table structure for table/p&#8221; $1 &gt; $TARGET_DIR/$tablename.sql<br />
to<br />
  zcat $1 | sed -n &#8220;/^&#8211; Table structure for table \`$tablename\`/,/^&#8211; Table structure for table/p&#8221; &gt;$TARGET_DIR/$tablename.sql</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gentoo Blog &#187; Extracting a Database From a mysqldump File</title>
		<link>http://kedar.nitty-witty.com/blog/mydumpsplitter-extract-tables-from-mysql-dump-shell-script/comment-page-2#comment-3272</link>
		<dc:creator>Gentoo Blog &#187; Extracting a Database From a mysqldump File</dc:creator>
		<pubDate>Tue, 02 Aug 2011 10:40:04 +0000</pubDate>
		<guid isPermaLink="false">http://kedar.nitty-witty.com/blog/?p=523#comment-3272</guid>
		<description>[...] Mysql dump-shell script Share on Facebook [...]</description>
		<content:encoded><![CDATA[<p>[...] Mysql dump-shell script Share on Facebook [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: harry</title>
		<link>http://kedar.nitty-witty.com/blog/mydumpsplitter-extract-tables-from-mysql-dump-shell-script/comment-page-2#comment-3268</link>
		<dc:creator>harry</dc:creator>
		<pubDate>Fri, 29 Jul 2011 08:27:11 +0000</pubDate>
		<guid isPermaLink="false">http://kedar.nitty-witty.com/blog/?p=523#comment-3268</guid>
		<description>Dear sir i found ur site today and today i have found your MyDumpSplitter script i have need this type of script from long period this is great for me and very very thanx to you</description>
		<content:encoded><![CDATA[<p>Dear sir i found ur site today and today i have found your MyDumpSplitter script i have need this type of script from long period this is great for me and very very thanx to you</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mydumpsplitter-Extract Tables From Mysql Dump-Shell Script &#124; Kastory</title>
		<link>http://kedar.nitty-witty.com/blog/mydumpsplitter-extract-tables-from-mysql-dump-shell-script/comment-page-2#comment-3165</link>
		<dc:creator>Mydumpsplitter-Extract Tables From Mysql Dump-Shell Script &#124; Kastory</dc:creator>
		<pubDate>Tue, 03 May 2011 07:48:37 +0000</pubDate>
		<guid isPermaLink="false">http://kedar.nitty-witty.com/blog/?p=523#comment-3165</guid>
		<description>[...] To see origi&amp;#110&amp;#97&amp;#108 posting on my blog: http://kedar.nitty-witty.com/blog/mydu&amp;#109&amp;#112&amp;#115plitter-extract-tables-from-mysql-dump-shell-sc...&amp;#10 [...]</description>
		<content:encoded><![CDATA[<p>[...] To see origi&amp;#110&amp;#97&amp;#108 posting on my blog: http://kedar.nitty-witty.com/blog/mydu&amp;#109&amp;#112&amp;#115plitter-extract-tables-from-mysql-dump-shell-sc&#8230;&amp;#10 [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kedar</title>
		<link>http://kedar.nitty-witty.com/blog/mydumpsplitter-extract-tables-from-mysql-dump-shell-script/comment-page-2#comment-2996</link>
		<dc:creator>Kedar</dc:creator>
		<pubDate>Thu, 17 Feb 2011 10:16:10 +0000</pubDate>
		<guid isPermaLink="false">http://kedar.nitty-witty.com/blog/?p=523#comment-2996</guid>
		<description>Hi Sandeep,

I hope you&#039;ve downloaded the MyDumpSplitter.sh file from download link.
Now, &quot;backup_feb15.log&quot; seems a log file than a backup file! Are you sure that its a mysqldump file?

-Kedar</description>
		<content:encoded><![CDATA[<p>Hi Sandeep,</p>
<p>I hope you&#8217;ve downloaded the MyDumpSplitter.sh file from download link.<br />
Now, &#8220;backup_feb15.log&#8221; seems a log file than a backup file! Are you sure that its a mysqldump file?</p>
<p>-Kedar</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sandeep</title>
		<link>http://kedar.nitty-witty.com/blog/mydumpsplitter-extract-tables-from-mysql-dump-shell-script/comment-page-2#comment-2995</link>
		<dc:creator>Sandeep</dc:creator>
		<pubDate>Thu, 17 Feb 2011 10:11:09 +0000</pubDate>
		<guid isPermaLink="false">http://kedar.nitty-witty.com/blog/?p=523#comment-2995</guid>
		<description>I am unable to extract a table called billing from the full db dump.

cdr_backup# ./MyDumpSplitter.sh backup_feb15.log billing
0 Table extracted from backup_feb15.log at .


Please help me on this
Thanks,
Sandeep</description>
		<content:encoded><![CDATA[<p>I am unable to extract a table called billing from the full db dump.</p>
<p>cdr_backup# ./MyDumpSplitter.sh backup_feb15.log billing<br />
0 Table extracted from backup_feb15.log at .</p>
<p>Please help me on this<br />
Thanks,<br />
Sandeep</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mydumpsplitter-Extract Tables From Mysql Dump-Shell Script &#124; Domainers</title>
		<link>http://kedar.nitty-witty.com/blog/mydumpsplitter-extract-tables-from-mysql-dump-shell-script/comment-page-2#comment-1609</link>
		<dc:creator>Mydumpsplitter-Extract Tables From Mysql Dump-Shell Script &#124; Domainers</dc:creator>
		<pubDate>Wed, 15 Dec 2010 06:02:33 +0000</pubDate>
		<guid isPermaLink="false">http://kedar.nitty-witty.com/blog/?p=523#comment-1609</guid>
		<description>[...] are welcome and I’ll update it whenever time permits.To see original posting on my blog: http://kedar.nitty-witty.com/blog/mydumpsplitter-extract-tables-from-mysql-dump-shell-script/Article from articlesbase.comOther Related [...]</description>
		<content:encoded><![CDATA[<p>[...] are welcome and I’ll update it whenever time permits.To see original posting on my blog: http://kedar.nitty-witty.com/blog/mydumpsplitter-extract-tables-from-mysql-dump-shell-script/Article from articlesbase.comOther Related [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: joe</title>
		<link>http://kedar.nitty-witty.com/blog/mydumpsplitter-extract-tables-from-mysql-dump-shell-script/comment-page-2#comment-1276</link>
		<dc:creator>joe</dc:creator>
		<pubDate>Thu, 02 Dec 2010 09:08:39 +0000</pubDate>
		<guid isPermaLink="false">http://kedar.nitty-witty.com/blog/?p=523#comment-1276</guid>
		<description>Thankyou so much! This saved me a lot of time..</description>
		<content:encoded><![CDATA[<p>Thankyou so much! This saved me a lot of time..</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mydumpsplitter-Extract Tables From Mysql Dump-Shell Script &#124; Database FAQ</title>
		<link>http://kedar.nitty-witty.com/blog/mydumpsplitter-extract-tables-from-mysql-dump-shell-script/comment-page-2#comment-749</link>
		<dc:creator>Mydumpsplitter-Extract Tables From Mysql Dump-Shell Script &#124; Database FAQ</dc:creator>
		<pubDate>Sat, 06 Nov 2010 23:50:59 +0000</pubDate>
		<guid isPermaLink="false">http://kedar.nitty-witty.com/blog/?p=523#comment-749</guid>
		<description>[...] To see original posting on my blog: http://kedar.nitty-witty.com/blog/mydumpsplitter-extract-tables-from-mysql-dump-shell-script/ [...]</description>
		<content:encoded><![CDATA[<p>[...] To see original posting on my blog: http://kedar.nitty-witty.com/blog/mydumpsplitter-extract-tables-from-mysql-dump-shell-script/ [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kedar</title>
		<link>http://kedar.nitty-witty.com/blog/mydumpsplitter-extract-tables-from-mysql-dump-shell-script/comment-page-2#comment-231</link>
		<dc:creator>Kedar</dc:creator>
		<pubDate>Fri, 17 Sep 2010 18:26:38 +0000</pubDate>
		<guid isPermaLink="false">http://kedar.nitty-witty.com/blog/?p=523#comment-231</guid>
		<description>Hey Andrey, I think you might have copied it from browser, try downloading it. I didn&#039;t understand when you say &quot;I get this when run without any arguments&quot;...</description>
		<content:encoded><![CDATA[<p>Hey Andrey, I think you might have copied it from browser, try downloading it. I didn&#8217;t understand when you say &#8220;I get this when run without any arguments&#8221;&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andrey Shipilov</title>
		<link>http://kedar.nitty-witty.com/blog/mydumpsplitter-extract-tables-from-mysql-dump-shell-script/comment-page-1#comment-230</link>
		<dc:creator>Andrey Shipilov</dc:creator>
		<pubDate>Fri, 17 Sep 2010 17:09:21 +0000</pubDate>
		<guid isPermaLink="false">http://kedar.nitty-witty.com/blog/?p=523#comment-230</guid>
		<description>Hey, looks like this script is just like what I need. But, it doesn&#039;t work for me.

Could you please help? I get this when run without any arguments. The filname is &quot;sp.sh&quot;. The output is:


: command not found
: command not found
sp.sh: line 23: syntax error near unexpected token `elif&#039;
&#039;p.sh: line 23: `elif [ $# = 1 ]; then

Please help.</description>
		<content:encoded><![CDATA[<p>Hey, looks like this script is just like what I need. But, it doesn&#8217;t work for me.</p>
<p>Could you please help? I get this when run without any arguments. The filname is &#8220;sp.sh&#8221;. The output is:</p>
<p>: command not found<br />
: command not found<br />
sp.sh: line 23: syntax error near unexpected token `elif&#8217;<br />
&#8216;p.sh: line 23: `elif [ $# = 1 ]; then</p>
<p>Please help.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Zodynas</title>
		<link>http://kedar.nitty-witty.com/blog/mydumpsplitter-extract-tables-from-mysql-dump-shell-script/comment-page-1#comment-226</link>
		<dc:creator>Zodynas</dc:creator>
		<pubDate>Tue, 07 Sep 2010 17:31:54 +0000</pubDate>
		<guid isPermaLink="false">http://kedar.nitty-witty.com/blog/?p=523#comment-226</guid>
		<description>omg, thanx man!!</description>
		<content:encoded><![CDATA[<p>omg, thanx man!!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: rack server</title>
		<link>http://kedar.nitty-witty.com/blog/mydumpsplitter-extract-tables-from-mysql-dump-shell-script/comment-page-1#comment-219</link>
		<dc:creator>rack server</dc:creator>
		<pubDate>Sun, 25 Jul 2010 02:31:21 +0000</pubDate>
		<guid isPermaLink="false">http://kedar.nitty-witty.com/blog/?p=523#comment-219</guid>
		<description>nice tips, thanks for share.</description>
		<content:encoded><![CDATA[<p>nice tips, thanks for share.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kedar</title>
		<link>http://kedar.nitty-witty.com/blog/mydumpsplitter-extract-tables-from-mysql-dump-shell-script/comment-page-1#comment-204</link>
		<dc:creator>Kedar</dc:creator>
		<pubDate>Sun, 30 May 2010 13:14:00 +0000</pubDate>
		<guid isPermaLink="false">http://kedar.nitty-witty.com/blog/?p=523#comment-204</guid>
		<description>@guroot: Welcome dude!
@will pink: So where can we have it anyways ? Glad to know it helped as it meant to be :)</description>
		<content:encoded><![CDATA[<p>@guroot: Welcome dude!<br />
@will pink: So where can we have it anyways ? Glad to know it helped as it meant to be <img src='http://kedar.nitty-witty.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: will pink</title>
		<link>http://kedar.nitty-witty.com/blog/mydumpsplitter-extract-tables-from-mysql-dump-shell-script/comment-page-1#comment-203</link>
		<dc:creator>will pink</dc:creator>
		<pubDate>Sun, 30 May 2010 12:37:59 +0000</pubDate>
		<guid isPermaLink="false">http://kedar.nitty-witty.com/blog/?p=523#comment-203</guid>
		<description>I definitely owe you a beer, started scripting one out then did a quick google and found your scripts many thanks!</description>
		<content:encoded><![CDATA[<p>I definitely owe you a beer, started scripting one out then did a quick google and found your scripts many thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: guroot</title>
		<link>http://kedar.nitty-witty.com/blog/mydumpsplitter-extract-tables-from-mysql-dump-shell-script/comment-page-1#comment-202</link>
		<dc:creator>guroot</dc:creator>
		<pubDate>Thu, 27 May 2010 13:04:55 +0000</pubDate>
		<guid isPermaLink="false">http://kedar.nitty-witty.com/blog/?p=523#comment-202</guid>
		<description>You saved my life ! Thanks dude !!!</description>
		<content:encoded><![CDATA[<p>You saved my life ! Thanks dude !!!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nick Peirson</title>
		<link>http://kedar.nitty-witty.com/blog/mydumpsplitter-extract-tables-from-mysql-dump-shell-script/comment-page-1#comment-200</link>
		<dc:creator>Nick Peirson</dc:creator>
		<pubDate>Mon, 17 May 2010 13:39:38 +0000</pubDate>
		<guid isPermaLink="false">http://kedar.nitty-witty.com/blog/?p=523#comment-200</guid>
		<description>For extracting databases from a mysql dump the following php script is much quicker. The shell script parses the file for table names, then passes the whole file to sed once per table. This takes quite a while for a large dump (I&#039;m currently looking at a 30GB dump). The php script gets the tables, splitting the file in one pass. It uses little memory as it only holds the currently examined line in memory. The first argument to the script is the filename of the full dump. Script is quick and dirty, so no error checking or option to just get one db, but both could be added trivially. Hope someone finds this useful.


&lt;?php
$db = null;
$outfp = null;
$infp = fopen($argv[1], &#039;r&#039;);
while($line = fgets($infp)){
    if(preg_match(&#039;/-- Current Database: `([^`]+)`/&#039;,$line,$matches)){
        if($outfp){
            fclose($outfp);
        }
        $db = $matches[1];
        $outfp = fopen($db.&#039;.db.sql&#039;,&#039;w&#039;);
    }
    if($outfp){
        fwrite($outfp, $line);
    }
}</description>
		<content:encoded><![CDATA[<p>For extracting databases from a mysql dump the following php script is much quicker. The shell script parses the file for table names, then passes the whole file to sed once per table. This takes quite a while for a large dump (I&#8217;m currently looking at a 30GB dump). The php script gets the tables, splitting the file in one pass. It uses little memory as it only holds the currently examined line in memory. The first argument to the script is the filename of the full dump. Script is quick and dirty, so no error checking or option to just get one db, but both could be added trivially. Hope someone finds this useful.</p>
<p>&lt;?php<br />
$db = null;<br />
$outfp = null;<br />
$infp = fopen($argv[1], &#039;r&#039;);<br />
while($line = fgets($infp)){<br />
    if(preg_match(&#039;/&#8211; Current Database: `([^`]+)`/&#039;,$line,$matches)){<br />
        if($outfp){<br />
            fclose($outfp);<br />
        }<br />
        $db = $matches[1];<br />
        $outfp = fopen($db.&#039;.db.sql&#039;,&#039;w&#039;);<br />
    }<br />
    if($outfp){<br />
        fwrite($outfp, $line);<br />
    }<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kedar</title>
		<link>http://kedar.nitty-witty.com/blog/mydumpsplitter-extract-tables-from-mysql-dump-shell-script/comment-page-1#comment-197</link>
		<dc:creator>Kedar</dc:creator>
		<pubDate>Fri, 12 Mar 2010 16:06:04 +0000</pubDate>
		<guid isPermaLink="false">http://kedar.nitty-witty.com/blog/?p=523#comment-197</guid>
		<description>1. Script Updated.
2. Video &quot;How to use&quot; attached!!
p.s.: It&#039;s my first screen cast - I&#039;ll improve soon.</description>
		<content:encoded><![CDATA[<p>1. Script Updated.<br />
2. Video &#8220;How to use&#8221; attached!!<br />
p.s.: It&#8217;s my first screen cast &#8211; I&#8217;ll improve soon.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kedar</title>
		<link>http://kedar.nitty-witty.com/blog/mydumpsplitter-extract-tables-from-mysql-dump-shell-script/comment-page-1#comment-195</link>
		<dc:creator>Kedar</dc:creator>
		<pubDate>Thu, 25 Feb 2010 12:20:41 +0000</pubDate>
		<guid isPermaLink="false">http://kedar.nitty-witty.com/blog/?p=523#comment-195</guid>
		<description>Hi Robert,
I&#039;m glad to see it&#039;s working as expected.

Now about your regexp, for sure if you want to extract &quot;tasks&quot; table you shouldn&#039;t have used REGEXP mode... you should have directly specified the table name as &quot;tasks_XYZ&quot; will obviously a match to the regexp!
I hope I got what you&#039;ve said?!!

Meanwhile, for extracting Databases from a fulldump following will help:


#Shell Script To Extract Database from Full Dump
for dbz in $(grep &quot;\-\- Current Database&quot; $1  &#124; sed &#039;s/`//g&#039; &#124; awk -F &quot;: &quot; {&#039;print $2&#039;}&#124;sort&#124;uniq)
do
        echo $dbz;
        sed -n &quot;/^-- Current Database: \`$dbz\`/,/^-- Current Database: \`/p&quot; $1 &gt; $dbz.db.sql
done;</description>
		<content:encoded><![CDATA[<p>Hi Robert,<br />
I&#8217;m glad to see it&#8217;s working as expected.</p>
<p>Now about your regexp, for sure if you want to extract &#8220;tasks&#8221; table you shouldn&#8217;t have used REGEXP mode&#8230; you should have directly specified the table name as &#8220;tasks_XYZ&#8221; will obviously a match to the regexp!<br />
I hope I got what you&#8217;ve said?!!</p>
<p>Meanwhile, for extracting Databases from a fulldump following will help:</p>
<p>#Shell Script To Extract Database from Full Dump<br />
for dbz in $(grep &#8220;\-\- Current Database&#8221; $1  | sed &#8216;s/`//g&#8217; | awk -F &#8220;: &#8221; {&#8216;print $2&#8242;}|sort|uniq)<br />
do<br />
        echo $dbz;<br />
        sed -n &#8220;/^&#8211; Current Database: \`$dbz\`/,/^&#8211; Current Database: \`/p&#8221; $1 > $dbz.db.sql<br />
done;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Robert Stewart</title>
		<link>http://kedar.nitty-witty.com/blog/mydumpsplitter-extract-tables-from-mysql-dump-shell-script/comment-page-1#comment-194</link>
		<dc:creator>Robert Stewart</dc:creator>
		<pubDate>Tue, 23 Feb 2010 22:04:08 +0000</pubDate>
		<guid isPermaLink="false">http://kedar.nitty-witty.com/blog/?p=523#comment-194</guid>
		<description>Thanks! This saved me a bunch of time. I had a 35 GB dump file from which I needed to extract two tables. It took about 28 minutes to process the file. That was faster than loading the whole dumpfile and then dumping just the tables I needed.

One issue I had was that the script didn&#039;t separate tables with the same name, but in different databases. So, I ended up with one .sql file with the drop, create and insert statements for two tables. I was confused for a while, because the resulting table was much too small. Finally, I realized that the smaller second table was replacing the first table when I loaded that .sql file.

Also, when specifying the table name, a regular expression is used that causes any suffix to also match. I had a table named &quot;tasks&quot; and a much larger table named &quot;tasks_archive&quot;, but I wanted only the statements for the tasks table. I assume it took a little extra time to also write out the tasks_archive table statements, but it wasn&#039;t that big of a deal, since I could obviously ignore it.</description>
		<content:encoded><![CDATA[<p>Thanks! This saved me a bunch of time. I had a 35 GB dump file from which I needed to extract two tables. It took about 28 minutes to process the file. That was faster than loading the whole dumpfile and then dumping just the tables I needed.</p>
<p>One issue I had was that the script didn&#8217;t separate tables with the same name, but in different databases. So, I ended up with one .sql file with the drop, create and insert statements for two tables. I was confused for a while, because the resulting table was much too small. Finally, I realized that the smaller second table was replacing the first table when I loaded that .sql file.</p>
<p>Also, when specifying the table name, a regular expression is used that causes any suffix to also match. I had a table named &#8220;tasks&#8221; and a much larger table named &#8220;tasks_archive&#8221;, but I wanted only the statements for the tasks table. I assume it took a little extra time to also write out the tasks_archive table statements, but it wasn&#8217;t that big of a deal, since I could obviously ignore it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Shlomi Noach</title>
		<link>http://kedar.nitty-witty.com/blog/mydumpsplitter-extract-tables-from-mysql-dump-shell-script/comment-page-1#comment-190</link>
		<dc:creator>Shlomi Noach</dc:creator>
		<pubDate>Thu, 11 Feb 2010 10:16:12 +0000</pubDate>
		<guid isPermaLink="false">http://kedar.nitty-witty.com/blog/?p=523#comment-190</guid>
		<description>Hi Kedar,
Good work!
I was also considering writing such a script (python). What I see is still missing is as follows:
- working with streaming (e.g. mysqldump mydb &#124; mydumpsplit.sh)
- Managing those little thinks, such as disabling FK checks per split table, charsets...
- Handling triggers, stored routines.

PS, doing the reverse: loading the distinct tables back into mysql can be easily accomplished with Maatkit&#039;s mk-parallel-restore (which also serves as a general-purpose parallelizing tool last I checked).</description>
		<content:encoded><![CDATA[<p>Hi Kedar,<br />
Good work!<br />
I was also considering writing such a script (python). What I see is still missing is as follows:<br />
- working with streaming (e.g. mysqldump mydb | mydumpsplit.sh)<br />
- Managing those little thinks, such as disabling FK checks per split table, charsets&#8230;<br />
- Handling triggers, stored routines.</p>
<p>PS, doing the reverse: loading the distinct tables back into mysql can be easily accomplished with Maatkit&#8217;s mk-parallel-restore (which also serves as a general-purpose parallelizing tool last I checked).</p>
]]></content:encoded>
	</item>
</channel>
</rss>

