Can't create/write to file '/tmp/#sql_1f98_0.MYI' (Errcode: 28)

February 28, 2018 11k views
MySQL Ubuntu

Hi, our Wordpress installation is getting this issue and returning this message:

Can't create/write to file '/tmp/#sql1f980.MYI' (Errcode: 28)

Can someone help with this?

Kind regards

3 Answers

By default the /tmp directory is writable by all and files in this directory are usually deleted on reboot. This error could indicate one of the following:

  • Somehow permissions on this file or on your /tmp directory were changed and the MySQL process no longer has permission to write the file it needs.
  • For some reason the service is being blocked from writing to the file, possible if there is an existing process already running.
  • Your disk has run out of space preventing the service from writing the file it needs.

I would recommend first rebooting your droplet. This should clear most if not all of the contents of /tmp and get rid of any hanging processes. If this does not resolve the issue, make sure the permissions and ownership of /tmp is correct.

  • can i reboot droplet from Digital Ocean control panel or do I need to do that from console terminal?

    • You can do so from the control panel. The reboot function there will attempt to do a soft reboot (the same as using the reboot command in the console). If the droplet fails to respond to the soft reboot after 5 minutes the system will force a hard reboot (like flipping the power switch on your computer).

Hello i've got the same issue we can't connect to the database anymore;

It is most probably the system is ran out of inodes. In my case PHP sessions are the issue. Check the inodes by run df -i
Solution :
rm -rf /var/lib/php/sessions/
mkdir /var/lib/php/sessions/ && chmod 1733 /var/lib/php/sessions/
Another reference:

Have another answer? Share your knowledge.