[debian-mysql] Bug#668593: mysql-server-5.1: "Incorrect key file for table" error when out of space (e.g. /tmp is tmpfs)

Ian Campbell ijc at hellion.org.uk
Fri Apr 13 09:36:40 UTC 2012

Package: mysql-server-5.1
Version: 5.1.61-3
Severity: normal

Recently my mysql instance (part of a mythtv installation, FWIW) started
failing with the following error:

[ERROR] /usr/sbin/mysqld: Incorrect key file for table '/tmp/#sql_6ea_0.MYI'; try to repair it

This turned out to be due to /tmp becoming a tmpfs over a recent upgrade. In
turn this meant that the free space on /tmp was much reduced and the error is
actually, I think, caused by an out-of-space condition. Setting RAMTMP to no in
/etc/default/rcS "fixed" the problem for me.

I'm not really sure if mysql's use of /tmp here is a valid one, the tmpfs had
2G of free space which, if mysql was using it all, is a rather large chunk to
be going into /tmp. Would /var/tmp be a better default?

Anyway I don't know if this is really a bug as such, but I thought it worth
reporting so at least it'll be noted somewhere that search engines might find,
since the error message was completely unrelated to the underling issue. It
seems like at a minimum mysql could report a clearer error when it runs out of


-- System Information:
Debian Release: wheezy/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing')
Architecture: i386 (i686)

Kernel: Linux 3.2.0-2-686-pae (SMP w/2 CPU cores)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages mysql-server-5.1 depends on:
ii  adduser                3.113+nmu1
ii  debconf [debconf-2.0]  1.5.42
ii  libc6                  2.13-27
ii  libdbi-perl            1.618-1
ii  libgcc1                1:4.7.0-3
ii  libmysqlclient16       5.1.61-3
ii  libstdc++6             4.7.0-3
ii  lsb-base               4.1+Debian0
ii  mysql-client-5.1       5.1.61-3
ii  mysql-common           5.1.61-3
ii  mysql-server-core-5.1  5.1.61-3
ii  passwd                 1:4.1.5-1
ii  perl                   5.14.2-9
ii  psmisc                 22.16-1
ii  zlib1g                 1:1.2.6.dfsg-2

Versions of packages mysql-server-5.1 recommends:
ii  bsd-mailx [mailx]      8.1.2-0.20111106cvs-1
ii  libhtml-template-perl  2.91-1

Versions of packages mysql-server-5.1 suggests:
pn  tinyca  <none>

-- debconf information:
  mysql-server-5.1/start_on_boot: true
  mysql-server-5.1/postrm_remove_databases: false
  mysql-server-5.1/really_downgrade: false

More information about the pkg-mysql-maint mailing list