MySQL release free disk space.

When perform some data clean up in MySQL, found that no disk space was release and MySQL still occupied it.

Here is the command to check those tables with more than 300MB of data:

View Code MYSQL
USE <DATABASE NAME>;
show table status where data_length > 300000000

In order to force MySQL release the disk space, just perform a simple MySQL command:

View Code MYSQL
OPTIMIZE TABLE <TABLE_NAME>

Leave a Reply