Today we had a very interesting phenomena at a customer. He complained that MySQL always get some errors of the following type:
[ERROR] mysqld: Sort aborted: Error writing file '/tmp/MYGbBrpA' (Errcode: 28 - No space left on device)
After a first investigation we found that
df -h /tmp shows from time to time a full disk but we could not see any file with
ls -la /tmp/MY*.
After some more investigation we found even the query from the Slow Query Log which was producing the same problem. It looked similar to this query: