要获取 MySQL 数据库中表的尺寸,可以使用“information_schema.tables”。以下是了解所有表尺寸的语法。SELECT TABLE_NAME AS `ALLTABLESNAME`, ROUND((DATA_LENGTH + INDEX_LENGTH) / 1024 / 1024) AS `TABLESIZEIN(MB)` FROM information_schema.TABLES WHERE TABLE_SCHEMA = "yourDatabaseName" ORDER BY (DATA_LENGTH + INDEX_LENGTH) ASC;让我们应用上述语法来获取表的尺寸。mysql> SELECT TABLE_NAME AS `ALLTABLESNAME`, ROUND((DATA_LENGTH + INDEX_LENGTH) / 1024 / 1024) AS `TABLESIZEIN(MB)` -> FROM information_schema.TABLES WHERE TABLE_SCHEMA = "business" ... 阅读更多
要获取 MySQL 用户帐户列表,我们可以使用“SELECT USER”。以下是显示列表的查询。SELECT User FROM mysql.user; 以下是输出。+------------------+ | User | +------------------+ | John | | Mac | | Manish | | mysql.infoschema | | mysql.session ... 阅读更多