How can you determine how much disk space a particular MySQL table is taking up?

前端 未结 8 522
死守一世寂寞
死守一世寂寞 2020-11-30 16:20

Is there a quick way to determine how much disk space a particular MySQL table is taking up? The table may be MyISAM or Innodb.

8条回答
  •  执笔经年
    2020-11-30 17:03

    Taken from How do I check how much disk space my database is using?

    You can check MySQL table size either by looking at phpMyAdmin in your control panel by clicking on the database name in the left frame and reading the size for the tables in there in the right frame.

    The below query will as well help to get the same information in bytes

    select SUM(data_length) + SUM(index_length) as total_size 
    from information_schema.tables 
    where table_schema = 'db_name' 
    and table_name='table_name';
    

提交回复
热议问题