Create a gist now

Instantly share code, notes, and snippets.

MySQL delete all tables
#!/bin/bash
MYSQL="mysql -h HOST -u USERNAME -pPASSWORD -D DB_NAME"
$MYSQL -BNe "show tables" | awk '{print "set foreign_key_checks=0; drop table `" $1 "`;"}' | $MYSQL
unset MYSQL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment