http://www.perlmonks.org?node_id=527961


in reply to Size of mysql database/tables with perl

I am often in need of this info, and I usually resort to the one-liner way. Here is my personal recipe:

$ mysql dbname -e 'show table status' | \ perl -lane '$size += $F[6]+$F[8];END{print $size}'