MySQL: Can't create/write to file '/tmp/#sql_3c6_0.MYI' (Errcode: 2) - What does it even mean?

后端 未结 14 1002
忘掉有多难
忘掉有多难 2020-12-02 14:00

For some reason my production DB decided to spew out this message. All application calls fail to the DB with the error:

PreparedStatementCallback; SQL [ /*lo         


        
14条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-02 14:48

    For those using VPS / virtual hosting.

    I was using a VPS, getting errors with MySQL not being able to write to /tmp, and everything looked correct. I had enough free space, enough free inodes, correct permissions. Turned out the problem was outside my VPS, it was the machine hosting the VPS that was full. I only had "virtual space" in my file system, but the machine in the background which hosted the VPS had no "physical space" left. I had to contact the VPS company any they fixed it.

    If you think this might be your problem, you could test writing a larger file to /tmp (1GB):

    dd if=/dev/zero of=/tmp/file.txt count=1024 bs=1048576 
    

    I got a No space left on device error message, which was a giveaway that it was a disk/volume in the background that was full.

提交回复
热议问题