MySQL is unarguably one of the most popular databases being used by top IT companies like Google and Facebook. If you are one such hotshot dba working with MySQL databases, at some point in time you may need to figure out how big your database has grown. This is how you can do it.
Find the database size in MySQL
You may move to the directory containing the db files. In a default installation it would be under.
# cd /var/lib/mysql
Here you would see each database has its own directory with the name of database itself.
# cd /var/lib/mysql/rsyslogdb
# du -shc *
Will show you the size of all the files under this directory, this is the approx size of your database.
The second method is the simplest. You have to login to the db shell and the command below will display the database size.
SELECT table_schema "Data Base Name", SUM( data_length + index_length) / 1024 / 1024 "Data Base Size in MB" FROM information_schema.TABLES GROUP BY table_schema ;
Both methods show that my DB is about 68Mb in size.