List all MySQL Databases and show their sizes

2009-12-09 by xpheas
BASH-Code:
1
mysql -u root -p -e 'SELECT table_schema "Database", ROUND(SUM(data_length + index_length)/1024/1024, 4) "Size (MiB)" from information_schema.tables GROUP BY table_schema;'

BASH-Code:
1
2
3
4
5
6
7
+--------------------+------------+
| Database           | Size (MiB) |
+--------------------+------------+
| information_schema |     0.0039 | 
| mysql              |     0.5040 | 
| xpheascom          |     8.3756 | 
+--------------------+------------+

  « back

Feel Free to Leave a Comment

Name:*


Email: (not visible)


Website:


Comment:*