MySQL遇到The table is full排查过程

6 篇文章 2 订阅
3 篇文章 0 订阅

问题现象

有大量的数据要做数据清洗入库,在清洗快结束了的时候报错,如下

uncategorized SQLException; SQL state [HY000]; error code [1114]; The table 'task_master' is full; nested exception is java.sql.BatchUpdateException: The table 'task_master' is full

排查步骤

  • 根据The table 'task_master' is full提示猜测磁盘满了

  • 去数据库服务器查询硬盘空间情况

    df -h
    
  • 发现/data已经使用100%
    在这里插入图片描述

  • 进入data目录查询当前目录下文件大小,mysql目录占用了93G

    cd /data
    du -sh *
    

    在这里插入图片描述

  • 进入mysql目录,重复使用上一步的操作发现binlog目录占用了63G是罪魁祸首
    在这里插入图片描述

解决方案

进入到bin_log,我这里场景不需要bin_log备份还原所以直接删除了,大家自行斟酌是否进行服务器扩容

cd bin_log
find . -name 'mysql-bin*' -exec rm {} \

补充

后来百度搜索The table is full的时候,还有另外一种情况也会导致上述情况

You are using the MEMORY (HEAP) storage engine; in this case you
need to increase the value of the max_heap_table_size system variable.
See Section 5.1.3, “Server System Variables”.

解决办法是修改Mysql的配置文件my.ini,在[mysqld]下添加/修改两行:

tmp_table_size = 256M
max_heap_table_size = 256M

系统默认16M,修改完成后重启mysql

  • 2
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值