<?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: MySQL Empty Database / Delete or Drop All Tables</title> <atom:link href="http://www.cyberciti.biz/faq/how-do-i-empty-mysql-database/feed/" rel="self" type="application/rss+xml" /><link>http://www.cyberciti.biz/faq/how-do-i-empty-mysql-database/</link> <description>Every answer asks a more beautiful question.</description> <lastBuildDate>Fri, 10 Feb 2012 19:55:56 +0000</lastBuildDate> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.1</generator> <item><title>By: risdiyanto</title><link>http://www.cyberciti.biz/faq/how-do-i-empty-mysql-database/#comment-67634</link> <dc:creator>risdiyanto</dc:creator> <pubDate>Sat, 28 Jan 2012 04:38:22 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/how-do-i-empty-mysql-database/#comment-67634</guid> <description>is it possible to use simple truncate on database?</description> <content:encoded><![CDATA[<p>is it possible to use simple truncate on database?</p> ]]></content:encoded> </item> <item><title>By: Frank</title><link>http://www.cyberciti.biz/faq/how-do-i-empty-mysql-database/#comment-64425</link> <dc:creator>Frank</dc:creator> <pubDate>Mon, 14 Nov 2011 08:57:29 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/how-do-i-empty-mysql-database/#comment-64425</guid> <description>Yep, me too. Wish I had read this far down the comments lol</description> <content:encoded><![CDATA[<p>Yep, me too. Wish I had read this far down the comments lol</p> ]]></content:encoded> </item> <item><title>By: JP Lew</title><link>http://www.cyberciti.biz/faq/how-do-i-empty-mysql-database/#comment-63805</link> <dc:creator>JP Lew</dc:creator> <pubDate>Sat, 22 Oct 2011 17:06:45 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/how-do-i-empty-mysql-database/#comment-63805</guid> <description>thanks, exactly what I was looking for. I used this to replace my Wordpress database.</description> <content:encoded><![CDATA[<p>thanks, exactly what I was looking for. I used this to replace my WordPress database.</p> ]]></content:encoded> </item> <item><title>By: Sonet</title><link>http://www.cyberciti.biz/faq/how-do-i-empty-mysql-database/#comment-59728</link> <dc:creator>Sonet</dc:creator> <pubDate>Wed, 01 Jun 2011 04:06:36 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/how-do-i-empty-mysql-database/#comment-59728</guid> <description>Had to put the table name in quotes in the for loop:
$MYSQL -u $MUSER -p$MPASS $MDB -e &quot;drop table \`$t\`&quot;</description> <content:encoded><![CDATA[<p>Had to put the table name in quotes in the for loop:</p><p> $MYSQL -u $MUSER -p$MPASS $MDB -e &#8220;drop table \`$t\`&#8221;</p> ]]></content:encoded> </item> <item><title>By: Manasi</title><link>http://www.cyberciti.biz/faq/how-do-i-empty-mysql-database/#comment-57414</link> <dc:creator>Manasi</dc:creator> <pubDate>Tue, 19 Apr 2011 22:00:48 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/how-do-i-empty-mysql-database/#comment-57414</guid> <description>this was very useful....works great ! thanks !</description> <content:encoded><![CDATA[<p>this was very useful&#8230;.works great ! thanks !</p> ]]></content:encoded> </item> <item><title>By: Thiyagarajan Veluchamy</title><link>http://www.cyberciti.biz/faq/how-do-i-empty-mysql-database/#comment-55543</link> <dc:creator>Thiyagarajan Veluchamy</dc:creator> <pubDate>Fri, 11 Feb 2011 16:45:36 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/how-do-i-empty-mysql-database/#comment-55543</guid> <description>Thanks for nice ppost</description> <content:encoded><![CDATA[<p>Thanks for nice ppost</p> ]]></content:encoded> </item> <item><title>By: Sutharsan</title><link>http://www.cyberciti.biz/faq/how-do-i-empty-mysql-database/#comment-54983</link> <dc:creator>Sutharsan</dc:creator> <pubDate>Wed, 19 Jan 2011 09:41:15 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/how-do-i-empty-mysql-database/#comment-54983</guid> <description>Call me paranoid, but I don&#039;t like to put my database password in scripts. So I replaced the definition of MPASS with
&lt;pre&gt;
read -s -p &quot;Your database password: &quot; MPASS
&lt;/pre&gt;</description> <content:encoded><![CDATA[<p>Call me paranoid, but I don&#8217;t like to put my database password in scripts. So I replaced the definition of MPASS with</p><pre>
read -s -p "Your database password: " MPASS
</pre>]]></content:encoded> </item> <item><title>By: Ashok yadav</title><link>http://www.cyberciti.biz/faq/how-do-i-empty-mysql-database/#comment-50465</link> <dc:creator>Ashok yadav</dc:creator> <pubDate>Sun, 31 Oct 2010 09:33:36 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/how-do-i-empty-mysql-database/#comment-50465</guid> <description>To empty the database in MySql just go to the database and select the all tables (checkbox on of all tables) then select the &quot;empty&quot; action just down from the table names, then click &quot;GO&quot; button just right side of action selected .</description> <content:encoded><![CDATA[<p>To empty the database in MySql just go to the database and select the all tables (checkbox on of all tables) then select the &#8220;empty&#8221; action just down from the table names, then click &#8220;GO&#8221; button just right side of action selected .</p> ]]></content:encoded> </item> <item><title>By: herik</title><link>http://www.cyberciti.biz/faq/how-do-i-empty-mysql-database/#comment-50159</link> <dc:creator>herik</dc:creator> <pubDate>Mon, 18 Oct 2010 02:44:53 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/how-do-i-empty-mysql-database/#comment-50159</guid> <description>Thank&#039;s A lot.  For method#2 : it works!</description> <content:encoded><![CDATA[<p>Thank&#8217;s A lot.  For method#2 : it works!</p> ]]></content:encoded> </item> <item><title>By: Shweta</title><link>http://www.cyberciti.biz/faq/how-do-i-empty-mysql-database/#comment-49296</link> <dc:creator>Shweta</dc:creator> <pubDate>Mon, 06 Sep 2010 09:29:53 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/how-do-i-empty-mysql-database/#comment-49296</guid> <description>thanks for the valuable information :)</description> <content:encoded><![CDATA[<p>thanks for the valuable information :)</p> ]]></content:encoded> </item> <item><title>By: Russell</title><link>http://www.cyberciti.biz/faq/how-do-i-empty-mysql-database/#comment-48461</link> <dc:creator>Russell</dc:creator> <pubDate>Wed, 21 Jul 2010 22:08:57 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/how-do-i-empty-mysql-database/#comment-48461</guid> <description>This worked perfecly.  Save me the monotony of deleting 300+ tables from a Magento Install</description> <content:encoded><![CDATA[<p>This worked perfecly.  Save me the monotony of deleting 300+ tables from a Magento Install</p> ]]></content:encoded> </item> <item><title>By: Jack</title><link>http://www.cyberciti.biz/faq/how-do-i-empty-mysql-database/#comment-48369</link> <dc:creator>Jack</dc:creator> <pubDate>Thu, 15 Jul 2010 17:42:20 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/how-do-i-empty-mysql-database/#comment-48369</guid> <description>How can i change this script so that it erases the rows from some defined tables?</description> <content:encoded><![CDATA[<p>How can i change this script so that it erases the rows from some defined tables?</p> ]]></content:encoded> </item> <item><title>By: Anonymous</title><link>http://www.cyberciti.biz/faq/how-do-i-empty-mysql-database/#comment-47581</link> <dc:creator>Anonymous</dc:creator> <pubDate>Mon, 31 May 2010 17:04:23 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/how-do-i-empty-mysql-database/#comment-47581</guid> <description>You should disable FOREIGN_KEY_CHECKS. I like Lon F. Binder solution.</description> <content:encoded><![CDATA[<p>You should disable FOREIGN_KEY_CHECKS. I like Lon F. Binder solution.</p> ]]></content:encoded> </item> <item><title>By: Clemens</title><link>http://www.cyberciti.biz/faq/how-do-i-empty-mysql-database/#comment-47412</link> <dc:creator>Clemens</dc:creator> <pubDate>Thu, 20 May 2010 10:42:36 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/how-do-i-empty-mysql-database/#comment-47412</guid> <description>I like this even more.
echo &quot;select concat(&#039;drop table &#039;, table_name, &#039;;&#039;) from information_schema.tables where table_schema=schema()&quot; &#124; mysql CONNECT &#124; grep &quot;^drop table &quot; &#124; mysql CONNECT
Make sure you connect to the right schema :p</description> <content:encoded><![CDATA[<p>I like this even more.</p><p>echo &#8220;select concat(&#8216;drop table &#8216;, table_name, &#8216;;&#8217;) from information_schema.tables where table_schema=schema()&#8221; | mysql CONNECT | grep &#8220;^drop table &#8221; | mysql CONNECT</p><p>Make sure you connect to the right schema :p</p> ]]></content:encoded> </item> <item><title>By: ANgie</title><link>http://www.cyberciti.biz/faq/how-do-i-empty-mysql-database/#comment-47327</link> <dc:creator>ANgie</dc:creator> <pubDate>Fri, 14 May 2010 02:39:56 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/how-do-i-empty-mysql-database/#comment-47327</guid> <description>I have an apple laptop i was the person earlier</description> <content:encoded><![CDATA[<p>I have an apple laptop i was the person earlier</p> ]]></content:encoded> </item> <item><title>By: Angie</title><link>http://www.cyberciti.biz/faq/how-do-i-empty-mysql-database/#comment-47326</link> <dc:creator>Angie</dc:creator> <pubDate>Fri, 14 May 2010 02:38:19 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/how-do-i-empty-mysql-database/#comment-47326</guid> <description>I want to erase everything that has been looked up on google and everything that has already been looked up like a restart how can i reboot?</description> <content:encoded><![CDATA[<p>I want to erase everything that has been looked up on google and everything that has already been looked up like a restart how can i reboot?</p> ]]></content:encoded> </item> <item><title>By: Harshit</title><link>http://www.cyberciti.biz/faq/how-do-i-empty-mysql-database/#comment-45186</link> <dc:creator>Harshit</dc:creator> <pubDate>Tue, 15 Dec 2009 15:50:59 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/how-do-i-empty-mysql-database/#comment-45186</guid> <description>I agree with Romina
I followed it and ended with completely deleting the database and not just the tables!! Your post title is absolutely incorrect. Please change it..
EVERYONE BE CAREFUL WHILE DOING THIS</description> <content:encoded><![CDATA[<p>I agree with Romina</p><p>I followed it and ended with completely deleting the database and not just the tables!! Your post title is absolutely incorrect. Please change it..</p><p>EVERYONE BE CAREFUL WHILE DOING THIS</p> ]]></content:encoded> </item> <item><title>By: Lon F. Binder</title><link>http://www.cyberciti.biz/faq/how-do-i-empty-mysql-database/#comment-43783</link> <dc:creator>Lon F. Binder</dc:creator> <pubDate>Tue, 22 Sep 2009 20:34:02 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/how-do-i-empty-mysql-database/#comment-43783</guid> <description>A little longer, but also a little more efficient because it does the drop (of all tables) in one shot:
&lt;code&gt;
mysql --user=YOUR_USERNAME --password=YOUR_PASSWORD -BNe &quot;show tables&quot; YOUR_DBSCHEMA_NAME &#124; tr &#039;\n&#039; &#039;,&#039; &#124; sed -e &#039;s/,$//&#039; &#124; awk &#039;{print &quot;SET FOREIGN_KEY_CHECKS = 0;DROP TABLE IF EXISTS &quot; $1 &quot;;SET FOREIGN_KEY_CHECKS = 1;&quot;}&#039; &#124; mysql --user=YOUR_USERNAME --password=YOUR_PASSWORD  YOUR_DBSCHEMA_NAME
&lt;/code&gt;</description> <content:encoded><![CDATA[<p>A little longer, but also a little more efficient because it does the drop (of all tables) in one shot:</p><p><code><br
/> mysql --user=YOUR_USERNAME --password=YOUR_PASSWORD -BNe "show tables" YOUR_DBSCHEMA_NAME | tr '\n' ',' | sed -e 's/,$//' | awk '{print "SET FOREIGN_KEY_CHECKS = 0;DROP TABLE IF EXISTS " $1 ";SET FOREIGN_KEY_CHECKS = 1;"}' | mysql --user=YOUR_USERNAME --password=YOUR_PASSWORD  YOUR_DBSCHEMA_NAME<br
/> </code></p> ]]></content:encoded> </item> <item><title>By: ddb</title><link>http://www.cyberciti.biz/faq/how-do-i-empty-mysql-database/#comment-41602</link> <dc:creator>ddb</dc:creator> <pubDate>Thu, 14 May 2009 05:20:05 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/how-do-i-empty-mysql-database/#comment-41602</guid> <description>You can use also:
mysql&gt; use database;
mysql&gt; truncate tablename;
to empty a table!</description> <content:encoded><![CDATA[<p>You can use also:<br
/> mysql&gt; use database;<br
/> mysql&gt; truncate tablename;<br
/> to empty a table!</p> ]]></content:encoded> </item> <item><title>By: OnkelBeh</title><link>http://www.cyberciti.biz/faq/how-do-i-empty-mysql-database/#comment-40694</link> <dc:creator>OnkelBeh</dc:creator> <pubDate>Wed, 11 Mar 2009 12:10:57 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/faq/how-do-i-empty-mysql-database/#comment-40694</guid> <description>What about :
&lt;code&gt;mysqldump -u[user] -p[ssht...] --add-drop-table --no-data [DATABASE] &#124; grep ^DROP &#124; mysql -u[user] -p[sshht...] [DATABASE]&lt;/code&gt;</description> <content:encoded><![CDATA[<p>What about :<br
/> <code>mysqldump -u[user] -p[ssht...] --add-drop-table --no-data [DATABASE] | grep ^DROP | mysql -u[user] -p[sshht...] [DATABASE]</code></p> ]]></content:encoded> </item> </channel> </rss>
