Very simple bash snippet to something similar to “drop tables like” in MySQL

mysql shop -BNe  "show tables like '[INSERT PATTERN HERE]'" | \
while read T; do mysql shop -e "drop table \`$T\`"; done

Nothing fancy here but this is much better than installing custom libraries to do the trick …

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre lang="" line="" escaped="" cssfile="">