This is what I do to get the actual count (no using the schema)
It's slower but more accurate.
It's a two step process at
Get list of tables for your db. You can get it using
mysql -uroot -p mydb -e "show tables"
mysql -uroot -p mydb -e "show tables"createCreate and assign the list of tables to the array variable in this bash script (separated by a single space just like in the code below)
array=( table1 table2 table3 )
for i in "${array[@]}"
do
echo $i
mysql -uroot mydb -e "select count(*) from $i"
done
array=( table1 table2 table3 ) for i in "${array[@]}" do echo $i mysql -uroot mydb -e "select count(*) from $i" donerunRun it:
chmod +x script.sh; ./script.sh
chmod +x script.sh; ./script.sh