Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
Tags
- 게임
- nestjs
- class
- Express
- MongoDB
- 정렬
- Queue
- 자료구조
- typeORM
- Bull
- Nest.js
- GIT
- mongoose
- game
- jest
- dfs
- 공룡게임
- Dinosaur
- JavaScript
- OCR
- TypeScript
- Python
- Sequelize
- AWS
- react
- nodejs
- flask
- MySQL
- cookie
Archives
- Today
- Total
포시코딩
[MySQL] 용량 확인 및 테이블 데이터 삭제 본문
728x90
SELECT
concat(table_schema,'.',table_name) AS "table",
concat(round(data_length/(1024*1024),2)," MB") AS data,
concat(round(index_length/(1024*1024),2)," MB") AS idx,
concat(round((data_length+index_length)/(1024*1024),2)," MB") AS total_size,
round(index_length/data_length,2) idxfrac
FROM
information_schema.TABLES
WHERE
table_rows is not null;
SELECT TABLE_NAME AS "Tables",
round(((data_length + index_length) / 1024 / 1024), 2) "Size in MB"
FROM information_schema.TABLES
WHERE table_schema = "exss"
ORDER BY (data_length + index_length) DESC;
테이블 데이터 idx = 1 제외하고 모두 삭제
DELETE FROM {table_name} WHERE idx <> 1;
728x90