다음은 schema 별 용량을 확인하는 쿼리이다.

SELECT table_schema, ROUND( SUM(( data_length + index_length ) / 1024 / 1024 ), 2 ) AS 'Size(mb)'
FROM information_schema.tables
GROUP BY table_schema;

 

다음은 table 별 용량을 확인하는 쿼리이다.

SELECT table_name, ROUND((( data_length + index_length ) / 1024 / 1024 ), 2 ) AS 'Size(mb)'
FROM information_schema.tables
WHERE table_name = 'name';


'DataBase > MySQL' 카테고리의 다른 글

[MySQL] my.cnf 위치 확인  (0) 2017.11.21
[MySQL] data 파일 경로(datadir) 변경  (0) 2017.11.15
[MySQL]my.cnf  (0) 2017.11.14
[MySQL] Character Set, Collation 확인  (0) 2017.11.13
[MySQL] MySQL에서 shell command 사용하기  (0) 2017.11.09

+ Recent posts