所有数据库用量以列表显示:
> SELECT table_schema "Database Name",SUM(data_length + index_length) / 1024 / 1024 "Size(MB)" FROM information_schema.TABLES GROUP BY table_schema;
如果只显示某个数据库,例如显示名为tohosting_db数据库的容量,可加where语句:
> SELECT table_schema "Database Name",SUM(data_length + index_length) / 1024 / 1024 "Size(MB)" FROM information_schema.TABLES WHERE table_schema = 'tohosting_db' GROUP BY table_schema;
|