background image
MySQL ERROR 1878 解决办法
错误重现
Part1:大表修改字段
mysql> ALTER TABLE `erp`
-> ADD COLUMN `eas_status` tinyint(3) unsigned NOT NULL DEFAULT 0 ' AFTER `totalprice`;
ERROR 1878 (HY000): Temporary file write failure.
mysql> \q
这里可以看到,添加字段的时候爆出了 1878 错误。
Part2:排错过程
先看数据库的 error 日志
1
2
3
4
5
6
7
8
9
1
0
1
1
1
2
1
3
1
4
1
5
2016-10-27 10:19:22 7f5dca1bf700 InnoDB: Error: Write to
file
(merge)
failed at offset 258998272.
InnoDB: 1048576 bytes should have been written, only 651264 were writ
ten.
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
2016-10-27 10:35:34 7f5dcb42f700 InnoDB: Error: Write to
file
(merge)
failed at offset 88080384.
InnoDB: 1048576 bytes should have been written, only 782336 were writ
ten.
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