亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定

MySQL ERROR 1878 解決辦法

標簽:
MySQL


wKioL1gRbvqjrVtcAAA4eVx2Dz8396.jpg

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: 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 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

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: http://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时需要的临时空间要比该表才行。由于笔者的水平有限,编写时间也很仓促,文中难免会出现一些错误或者不准确的地方,不妥之处恳请读者批评指正。

 

©著作权归作者所有:来自51CTO博客作者dbapower的原创作品,如需转载,请注明出处,否则将追究法律责任


點擊查看更多內容
TA 點贊

若覺得本文不錯,就分享一下吧!

評論

作者其他優質文章

正在加載中
  • 推薦
  • 評論
  • 收藏
  • 共同學習,寫下你的評論
感謝您的支持,我會繼續努力的~
掃碼打賞,你說多少就多少
贊賞金額會直接到老師賬戶
支付方式
打開微信掃一掃,即可進行掃碼打賞哦
今天注冊有機會得

100積分直接送

付費專欄免費學

大額優惠券免費領

立即參與 放棄機會
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號

舉報

0/150
提交
取消