Created
February 19, 2014 00:44
-
-
Save bageljp/9083937 to your computer and use it in GitHub Desktop.
mysql utility.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
MYSQL_DB="$1” | |
MYSQL_HOST=“${2:-localhost}” | |
MYSQL_PASS="${3:-password}" | |
mysql -u root -p${MYSQL_PASS} -h ${MYSQL_HOST} -s ${MYSQL_DB} -e "show tables;" | grep -v Tables_in_ | while read line; do | |
echo "== ${MYSQL_DB}.${line} =============================================================================" | |
mysql -u root -p${MYSQL_PASS} -h ${MYSQL_HOST} -s ${MYSQL_DB} -e "show create table ${MYSQL_DB}.${line};" | grep ENGINE | grep -v 'ENGINE=InnoDB' | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment