User Tools

Site Tools


pages:howtos:mysql:how-to-get-the-size-of-a-table-in-mysql

How To Get The Size Of A Table In MySQL

SELECT
  TABLE_NAME AS `Table`,
  ROUND((DATA_LENGTH + INDEX_LENGTH) / 1024 / 1024) AS `Size (MB)`
FROM
  information_schema.TABLES
WHERE
  TABLE_SCHEMA = "<name of database goes here>"
ORDER BY
  (DATA_LENGTH + INDEX_LENGTH)
DESC;


~~DISCUSSION~~

This website uses cookies. By using the website, you agree with storing cookies on your computer. Also you acknowledge that you have read and understand our Privacy Policy. If you do not agree leave the website.More information about cookies
pages/howtos/mysql/how-to-get-the-size-of-a-table-in-mysql.txt · Last modified: 2023/05/12 10:26 by Heiko Mischer