Zend_Db_Statement_Exception: SQLSTATE[HY000]: General error: 126 Incorrect key file for table '/tmp/#sql_.MYI'; try to repair it

Refers to:

  • Plesk
  • MG:58baf81e50d23195c4354da55a3378a6
  • MT:9cfe8948b72c25ac26d4bd04a1bdbd8b
  • MG:987f3f208fce89ddeeccb950672a7c05
  • MT:5ddd2b3d5e7665cb9a760bf4af95e1a8
  • MT:b5df09e9fde5d92e1782b321c6c51024
  • MG:0fdc4bbf1bdb478463aeabb21da2be92

Created:

2016-11-16 12:41:10 UTC

Modified:

2017-02-17 07:07:17 UTC

1

Was this article helpful?


Have more questions?

Submit a request

Zend_Db_Statement_Exception: SQLSTATE[HY000]: General error: 126 Incorrect key file for table '/tmp/#sql_.MYI'; try to repair it

Symptoms

Plesk displays the alike error in the interface:

ERROR: Zend_Db_Statement_Exception: SQLSTATE[HY000]: General error: 126 Incorrect key file for table '/tmp/#sql_3aef_0.MYI'; try to repair it (Pdo.php:234)

Cause

There is a lack of disk space on a partition, that MySQL uses for temporary files creation.

Resolution

Modify the 'my.cnf' file and set the 'tmpdir' directive to point to a partition, which has enough disk space. For example:

[mysqld]
tmpdir = /some/path/where/enough/space

On Linux : make sure that specified directory is readable, writable, executable for all users and has a sticky bit:

# ls -lda /some/path/where/enough/space
drwxrwxrwt 2 root root 4096 Jun 1 02:18 /some/path/where/enough/space

On Windows : make sure permissions as following:

> icacls "disk:\\where\\enough\\space"
disk:\\where\\enough\\space NT AUTHORITY\\NETWORK SERVICE:(CI)(RX,D,WD,AD)
WIN-HOSTNAME\\PP_WPG:(CI)(RX)
WIN-HOSTNAME\\psaserv:(CI)(RX)
WIN-HOSTNAME\\psacln:(CI)(RX)
WIN-HOSTNAME\\psaadm:(CI)(RX)
WIN-HOSTNAME\\psaadm:(OI)(IO)(R)
BUILTIN\\Users:(CI)(S,WD,AD,X)
BUILTIN\\IIS_IUSRS:(OI)(CI)(S,RD)
CREATOR OWNER:(OI)(CI)(IO)(F)
NT AUTHORITY\\SYSTEM:(OI)(CI)(F)
BUILTIN\\Administrators:(OI)(CI)(F)

On Windows, 'my.cnf' file can be found by checking the properties of 'MySQL' service ( Run > services.msc ). There should be an alike option in the service 'Path to execute': '--defaults-file=C:\\Program Files (x86)\\Parallels\\Plesk\\Databases\\MySQL\\Data\\my.ini'

On Linux, ' my.cnf' is located in the '/etc' or '/etc/mysql' directories, by default.

Alternatively, the disk space available for the server can be expanded, if it is a virtual machine or a container.

Have more questions? Submit a request
Please sign in to leave a comment.