MySQL数据库之MySQL ERROR 1878 解决办法
小标 2019-06-24 来源 : 阅读 1208 评论 0

摘要:本文主要向大家介绍了MySQL数据库之MySQL ERROR 1878 解决办法 ,通过具体的内容向大家展现,希望对大家学习MySQL数据库有所帮助。

本文主要向大家介绍了MySQL数据库之MySQL ERROR 1878 解决办法 ,通过具体的内容向大家展现,希望对大家学习MySQL数据库有所帮助。

MySQL数据库之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日志

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 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: //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 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: //dev.mysql.com/doc/refman/5.6/en/operating-system-error-codes.html
2016-10-27 10:37:02 7f5dd0076700 InnoDB: Error: Write to file (merge) failed at offset 88080384.
InnoDB: 1048576 bytes should have been written, only 770048 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: //dev.mysql.com/doc/refman/5.6/en/operating-system-error-codes.html


 查看错误日志可以看到磁盘空间不足


Part3:验证

[root@HE3 helei]# df -h

Filesystem            Size  Used Avail Use% Mounted on

/dev/mapper/VolGroup-lv_root

                       45G   43G  160M 100% /

tmpfs                 7.9G  1.2M  7.9G   1% /dev/shm

/dev/sda1             477M   90M  358M  21% /boot

 

可以看到磁盘空间不够了,需要释放磁盘空间,


——总结——

原因是mysql的tmpdir分区的剩余空间大小没有erp大。 mysql在alter table时需要的临时空间要比该表才行。由于笔者的水平有限,编写时间也很仓促,文中难免会出现一些错误或者不准确的地方,不妥之处恳请读者批评指正。

本文由职坐标整理并发布,希望对同学们学习MySQL有所帮助,更多内容请关注职坐标数据库MySQL数据库频道!

本文由 @小标 发布于职坐标。未经许可,禁止转载。
喜欢 | 0 不喜欢 | 0
看完这篇文章有何感觉?已经有0人表态,0%的人喜欢 快给朋友分享吧~
评论(0)
后参与评论

您输入的评论内容中包含违禁敏感词

我知道了

助您圆梦职场 匹配合适岗位
验证码手机号,获得海同独家IT培训资料
选择就业方向:
人工智能物联网
大数据开发/分析
人工智能Python
Java全栈开发
WEB前端+H5

请输入正确的手机号码

请输入正确的验证码

获取验证码

您今天的短信下发次数太多了,明天再试试吧!

提交

我们会在第一时间安排职业规划师联系您!

您也可以联系我们的职业规划师咨询:

小职老师的微信号:z_zhizuobiao
小职老师的微信号:z_zhizuobiao

版权所有 职坐标-一站式IT培训就业服务领导者 沪ICP备13042190号-4
上海海同信息科技有限公司 Copyright ©2015 www.zhizuobiao.com,All Rights Reserved.
 沪公网安备 31011502005948号    

©2015 www.zhizuobiao.com All Rights Reserved

208小时内训课程