在 Centos 7 中使用 Mariadb INNER JOIN 用户、数据库和数据库大小
INNER JOIN User, Database and Database Size using Mariadb in Centos 7
虽然我可以通过从进程列表中获取它来内部加入这三个,但问题是进程列表仅显示活动连接/数据库。除了 information_schema 中的 processlist 和 mysql 数据库中的 db,我可以在哪里使用其他 table。参见图像以了解 processlist 的结果。您可以看到它只显示活动数据库。
sample output
我正在使用的查询....
SELECT DB,USER,Round(sum(data_length + index_length) / 1024 / 1024 / 1024, 6) "Size in GB" FROM processlist INNER JOIN tables ON processlist.DB = tables.table_schema;
不清楚你在找什么。但是看看你是否喜欢
的输出
SELECT table_schema AS DB,
Round(sum(data_length + index_length) / 1024 / 1024 / 1024, 6) "Size in GB"
FROM information_schema.tables
GROUP BY table_schema;
虽然我可以通过从进程列表中获取它来内部加入这三个,但问题是进程列表仅显示活动连接/数据库。除了 information_schema 中的 processlist 和 mysql 数据库中的 db,我可以在哪里使用其他 table。参见图像以了解 processlist 的结果。您可以看到它只显示活动数据库。 sample output
我正在使用的查询....
SELECT DB,USER,Round(sum(data_length + index_length) / 1024 / 1024 / 1024, 6) "Size in GB" FROM processlist INNER JOIN tables ON processlist.DB = tables.table_schema;
不清楚你在找什么。但是看看你是否喜欢
的输出SELECT table_schema AS DB,
Round(sum(data_length + index_length) / 1024 / 1024 / 1024, 6) "Size in GB"
FROM information_schema.tables
GROUP BY table_schema;