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
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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时需要的临时空间要比该表才行。由于笔者的水平有限,编写时间也很仓促,文中难免会出现一些错误或者不准确的地方,不妥之处恳请读者批评指正。


 

 本文转自 dbapower 51CTO博客,原文链接:http://blog.51cto.com/suifu/1866212,如需转载请自行联系原作者



相关实践学习
每个IT人都想学的“Web应用上云经典架构”实战
本实验从Web应用上云这个最基本的、最普遍的需求出发,帮助IT从业者们通过“阿里云Web应用上云解决方案”,了解一个企业级Web应用上云的常见架构,了解如何构建一个高可用、可扩展的企业级应用架构。
MySQL数据库入门学习
本课程通过最流行的开源数据库MySQL带你了解数据库的世界。   相关的阿里云产品:云数据库RDS MySQL 版 阿里云关系型数据库RDS(Relational Database Service)是一种稳定可靠、可弹性伸缩的在线数据库服务,提供容灾、备份、恢复、迁移等方面的全套解决方案,彻底解决数据库运维的烦恼。 了解产品详情: https://www.aliyun.com/product/rds/mysql 
相关文章
|
关系型数据库 MySQL 数据库连接
解决 mysql8.0 ERROR 1045 (28000): Access denied for user ‘ODBC‘@‘localhost‘ (using password: NO)用户访问拒绝
解决 mysql8.0 ERROR 1045 (28000): Access denied for user ‘ODBC‘@‘localhost‘ (using password: NO)用户访问拒绝
9132 52
解决 mysql8.0 ERROR 1045 (28000): Access denied for user ‘ODBC‘@‘localhost‘ (using password: NO)用户访问拒绝
|
关系型数据库 MySQL Docker
docker pull mysql:8.0.26提示Error response from daemon: Get “https://registry-1.docker.io/v2/“: EOF错误
docker pull mysql:8.0.26提示Error response from daemon: Get “https://registry-1.docker.io/v2/“: EOF错误
5212 9
|
SQL 关系型数据库 MySQL
mysql密码错误-ERROR 1045 (28000): Access denied for user ‘root‘@‘localhost‘ (using passwor:yes)
这篇文章提供了解决MySQL数据库"Access denied for user 'root'@'localhost' (using password: YES)"错误的方法,通过跳过密码验证、修改root密码,然后重启服务来解决登录问题。
mysql密码错误-ERROR 1045 (28000): Access denied for user ‘root‘@‘localhost‘ (using passwor:yes)
|
缓存 关系型数据库 MySQL
error: Failed dependencies: mariadb-connector-c-config is obsoleted by mysql-community-server-8.0.36-1.el7.x86_64 问题解决
error: Failed dependencies: mariadb-connector-c-config is obsoleted by mysql-community-server-8.0.36-1.el7.x86_64 问题解决
1328 19
|
数据采集 中间件 关系型数据库
Mac系统通过brew安装mysql5.7后,启动报错的解决办法
Mac系统通过brew安装mysql5.7后,启动报错的解决办法
1507 2
|
SQL 关系型数据库 MySQL
问题1:Navicat连接不上mysql8的简单解决办法
问题1:Navicat连接不上mysql8的简单解决办法
2943 2
|
关系型数据库 MySQL
MySQL 8.0 - Authentication plugin ‘caching_sha2_password‘ cannot be loaded 原因及解决办法
MySQL 8.0 - Authentication plugin ‘caching_sha2_password‘ cannot be loaded 原因及解决办法
909 1
|
关系型数据库 MySQL 测试技术
MySQL 报错 ERROR 1709: Index column size too large
MySQL 报错 ERROR 1709: Index column size too large
989 4
|
关系型数据库 MySQL Linux
error: Failed dependencies: libncurses.so.5()(64bit) is needed by mysql-community-client-8.0.36-1.el7.x86_64 libtinfo.so.5()(64bit) is needed by mysql-community-client-8.0.36-1.el7.x86_64 如何解决?
error: Failed dependencies: libncurses.so.5()(64bit) is needed by mysql-community-client-8.0.36-1.el7.x86_64 libtinfo.so.5()(64bit) is needed by mysql-community-client-8.0.36-1.el7.x86_64 如何解决?
2663 3
|
网络协议 关系型数据库 MySQL
MySQL报ERROR 2002 (HY000)解决
通过上述步骤,可以有效地解决MySQL连接时出现的 `ERROR 2002 (HY000)`错误。这些步骤包括检查和启动MySQL服务、配置文件检查、套接字文件检查、日志文件分析、进程检查、防火墙设置、客户端配置和最终的MySQL重装。确保每个步骤都按顺序执行,有助于快速定位和解决问题,使MySQL服务器恢复正常运行。
11634 0

推荐镜像

更多