可以通过以下步骤查询MySQL数据库的大小: 1、登录MySQL数据库: mysql-uusername-p 2、选择要查询的数据库: usedatabase_name; 3、运行以下查询语句: SELECTtable_schema"DatabaseName", sum(data_length+index
可以通过以下步骤查询MySQL数据库的大小:
1、登录MySQL数据库:
mysql-uusername-p
2、选择要查询的数据库:
usedatabase_name;
3、运行以下查询语句:
SELECTtable_schema"DatabaseName",
sum(data_length+index_length)/1024/1024"DatabaseSize(MB)"
FROMinformation_schema.TABLES
GROUPBYtable_schema;
这个查询语句会返回所有数据库的大小(以MB为单位),包括数据和索引的大小。
版权声明
本文仅代表作者观点,不代表博信信息网立场。