HiveBrain v1.2.0
Get Started
← Back to all entries
patternsqlMinor

Temporary file write failure on MySQL

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
filetemporarywritemysqlfailure

Problem

When running an ALTER TABLE ... ADD COLUMN ... I get:

Error Code : 1878
Message    : Temporary file write failure.


And on log_error (/DATA/mysql/.err)

2016-06-29 17:27:01 7f11f08a7700 InnoDB: Error: Write to file (merge) failed at offset 3145728.
InnoDB: 1048576 bytes should have been written, only 327680 were written.
InnoDB: Operating system error number 0.
InnoDB: Check that your OS and file system support files of this size.
InnoDB: Check also that the disk is not full or a disk quota exceeded.
InnoDB: Error number 0 means 'Success'.
InnoDB: Some operating system error numbers are described at
InnoDB: http://dev.mysql.com/doc/refman/5.6/en/operating-system-error-codes.html


Context

  • I'm running MySQL on a VM. Guest is SuSE, host is Windows 7.



  • Got the error after having dropped the schema and recreating it from a dump.



  • I had the same error one day ago (except the statement was a create index), and it just spontaneously stopped happening. But this time it's happening for a while.



  • If I keep retrying, the count of bytes written in the logs gets smaller every once in a while.

Solution

if you are using docker and docker-compose you can add a line to your volumes to a spot where you have more disk space. E.g.,

volumes:
  - /data/mysql_tmp:/tmp


Again, this will allow you to get more than the default tmp space you need and is helpful if that table you are ALTER-ing is big (over 1.9 GB) as our docker had like 3.8GB /tmp

Code Snippets

volumes:
  - /data/mysql_tmp:/tmp

Context

StackExchange Database Administrators Q#142584, answer score: 3

Revisions (0)

No revisions yet.