Find out your current MySQL database sizes

What if you want to know the actual size of a specific or all databases on your MySQL server. You can do an "du -sh" on your data folder where your MySQL databases stored. But there is a better and more specific way. Login with a user with enough permissions to MySQL:

root@server:~# mysql -u root -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1515
Server version: 5.5.34-0ubuntu0.13.04.1 (Ubuntu)

Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

Now enter the following query:

SELECT table_schema "Database Name", sum( data_length + index_length ) /
1024 / 1024 "Database Size in MB" FROM information_schema.TABLES GROUP BY table_schema ; 

And see the results below:

mysql> SELECT table_schema "Database Name", sum( data_length + index_length ) /
    -> 1024 / 1024 "Database Size in MB" FROM information_schema.TABLES GROUP BY table_schema ;
+--------------------+----------------------+
| Database Name      | Database Size in MB  |
+--------------------+----------------------+
| cacti              |          75.52146626 |
| cacti-old          |         130.71428585 |
| information_schema |           0.00781250 |
| mysql              |           0.62399578 |
| phpmyadmin         |           0.02734375 |
+--------------------+----------------------+
5 rows in set (0.09 sec)