0

i ran out of disk space while running an alter table on a large table. I restarted MySQL afterwards and checked the MySQL tmp dir. A show status like '%tmp%' lists 5 tmp files and 4 tmp tables. A df still shows 99% disk usage (was like 72% before the alter table).

Running a "check table" returns "OK".

How to clean up the disk space used by the alter table command?

I'm running MySQL 5.5.31 on Ubuntu 12.04.

Thanks: Lars

bitrocker
  • 117
  • 1
  • 2
  • you can use some ram partition for `tmptable` instead of hdd, this can be better for space and performance – user973254 Nov 08 '13 at 20:23
  • Unfortunately the server only has 8 GB ram and i assume MySQL needs like 20 GB to complete the alter table process. – bitrocker Nov 09 '13 at 21:20

1 Answers1

0

Common approach to find where your space has gone.

  1. check for explicit files disk usage with du -ms /path/*.
  2. check "hidden" open files disk usage with lsof | grep deleted | grep /path
  3. last resort: check the file-system consistency.
Veniamin
  • 863
  • 6
  • 11
  • I just mentioned InnoDB in the tags, sorry. There are no tmp files, it's just InnoDB's ibdata file that now is 40 GB. – bitrocker Nov 09 '13 at 21:22
  • Ok in that case a usefull link for you: http://stackoverflow.com/questions/3456159/how-to-shrink-purge-ibdata1-file-in-mysql – Veniamin Nov 10 '13 at 07:36