Skip to content

Instantly share code, notes, and snippets.

@lsaffie
Last active September 23, 2015 16:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save lsaffie/9622244 to your computer and use it in GitHub Desktop.
Save lsaffie/9622244 to your computer and use it in GitHub Desktop.
get count of tables
DBUSER="root"
DBPASS=""
DBNAME="dbname"
array=( a b c )
for i in "${array[@]}"
do
echo $i
mysql -u$DBUSER $DBNAME -p$DBPASS -e "select count(*) from $i"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment