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

前端 未结 8 551
死守一世寂寞
死守一世寂寞 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 16:55

    I would just use 'mysqldiskusage' tool as follow

    $ mysqldiskusage --server=user:password@localhost mydbname
    # Source on localhost: ... connected.
    
    # Database totals:
    +------------+----------------+
    | db_name    |         total  |
    +------------+----------------+
    | mydbaname  | 5,403,033,600  |
    +------------+----------------+
    
    Total database disk usage = 5,403,033,600 bytes or 5.03 GB
    

提交回复
热议问题