How to monitor MySQL space?

前端 未结 6 1485
死守一世寂寞
死守一世寂寞 2021-01-31 20:48

I downloaded a VM image of a web application that uses MySQL.

How can I monitor its space consumption and know when additional space must be added?

6条回答
  •  梦如初夏
    2021-01-31 21:36

    If only MySQL is available, use the SHOW TABLE STATUS command, and look at the Data_length column for each table, which is in bytes.

    If you have other languages available on the machine, a script in any of them that runs regularly (cron), checks disk free space or size of database directory, and updates you over e-mail or otherwise. There are far too many options to suggest a particular solution -- it depends on your situation.

提交回复
热议问题