This is simple, run the below query
SELECT table_schema AS "Database", ROUND(SUM(data_length + index_length) / 1024 / 1024, 2) AS "Size (MB)" FROM information_schema.TABLES GROUP BY table_schema;
This will list all the databases and show their size in Mb.
Similarly we can get the size of tables in a particular database as
SELECT table_name AS "Table", ROUND(((data_length + index_length) / 1024 / 1024), 2) AS "Size (MB)" FROM information_schema.TABLES WHERE table_schema = "your_database_name" ORDER BY (data_length + index_length) DESC;