Text only
Drop multiple tables wildcard
/raw/e5a728f8eb841e563749391bd636044e/
e5a728f8eb841e563749391bd636044e
text
Text only
3
2025-04-04T11:37:09
True
False
False
Jun 24, 2019 at 02:30 PM
/api/public/snipt/72/
drop-multiple-tables-wildcard
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a>
<a href="#L-2">2</a>
<a href="#L-3">3</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>mysql -u root -D db_name -e "show tables" -s |
</span><span id="L-2"><a name="L-2"></a> egrep "^wp_2_" |
</span><span id="L-3"><a name="L-3"></a> xargs -I "@@" echo mysql -u root -D db_name -e "DROP TABLE @@"
</span></pre></div>
</td></tr></table>