You can also read this at my Blogger: https://prgexp.blogspot.com/2019/06/want-to-know-your-mysql-database-size.html
Well, you can try the script below:
Select
table_schema As “Database Name”,
Round(Sum(data_length + index_length) / 1024 / 1024, 2) As “Database Size in MB”
From information_schema.Tables
Where table_schema = ‘xxxxx’
Group By table_schema
Order By table_schema;