Created
December 6, 2017 03:32
-
-
Save forthxu/e2233666dff7eb5ad176d77516df212e to your computer and use it in GitHub Desktop.
批量处理mysql数据表
This file contains hidden or 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 | |
tables=`mysql -uroot jipai -e "select table_name from information_schema.tables where table_schema='jipai' and table_type='base table';" --batch --raw --skip-column-names` | |
for table in ${tables[@]} | |
do | |
echo ${table}, `mysql -uroot jipai -e "select count(*) from ${table};" --skip-column-names` | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment