1、mysql 数据库数据量查询
sql
SELECT SUM(table_rows) FROM TABLES WHERE TABLE_SCHEMA = '数据库名称' ORDER BY table_rows DESC;
select concat(round(sum(DATA_LENGTH/1024/1024),2),'MB') as data from TABLES where table_schema='数据库名称';
2、postgresql 数据库数据量查询
sql
select pg_size_pretty(pg_database_size('数据库名称')) as size;