一、报错

今天测试区debug程序遇到如下报错,数据落库失败。

mysql Caused by: java.sql.SQLException: The table 'tablename' is full

二、解决

保证error之后参考了前辈的文章。

排查MySQL的 information_schema 数据库中的TABLES 该表所占的空间。

使用指令: show table status like 'm_rtm_rule_d%';

m_rtm_rule_d InnoDB  10  Compact 178387  430 76824576    0   0   6291456 577693  2019-10-31 13:51:35         utf8_unicode_ci         

如下sql查询某个数据库的表碎片化情况。或者data_free超过50M大小的表。

data_free: 该参数与mysql碎片有关,如果是共享表空间,该字段表示共享表空间的大小而非数据的大小。只有使用独占表空间时,该字段才表示该表的剩余空间;

table 该字段超过50MB 代表碎片大小

select concat( table_schema, '.', table_name ) as TABLE_NAME, engine as TABLE_ENGINE, table_type as TABLE_TYPE, table_rows as TABLE_ROWS, concat( round( data_length /( 1024 * 1024 ), 2 ), 'M' ) as TB_DATA_SIZE, concat( round( index_length /( 1024 * 1024 ), 2 ), 'M' ) as TB_IDX_SIZE, concat( round(( data_length + index_length )/( 1024 * 1024 ), 2 ), 'M' ) as TOTAL_SIZE, case
when data_length = 0 then 0
else round( index_length / data_length, 2 )
end as TB_INDX_RATE, concat( round( data_free / 1024 / 1024, 2 ), 'MB' ) as TB_DATA_FREE, case
when( data_length + index_length )= 0 then 0
else round( data_free /( data_length + index_length ), 2 )
end as TB_FRAG_RATE
from information_schema.TABLES
where round( DATA_FREE / 1024 / 1024, 2 )>= 50
order by data_free desc;

查询完之后发现表没占多少空间,data_free确实有点多。

接优化表

optimize table m_rtm_rule_d,m_rtm_sub_rule_d;

不支持.....让使用analyze 来代替使用

分析完之后发现data_free 还是很高。

另外一个方法:

可以先drop table然后重建即可。先建立新表然后导入数据,然后rename。

这一波操作袭来,再查看时data_free变成了0.

然而问题还在法还在发生。

最后发现是mysql 数据文件的文件系统磁盘使用率 100%了。

发现一个134GB 的怪物。这个文件里面存放的是当时分析redis的rdb dump文件。

把不用的数据清除掉之后,报错消失了。

Mysql 报错 The table ‘tablename‘ is full解决方案相关推荐

  1. Docker安装mysql 报错 InnoDB: Table flags are 0 in the data dictionary but the flags in file

    docker 安装mysql5.7 docker run -d -p 3306:3306 -v /data/mysql/conf:/etc/mysql/conf.d -v /data/mysql/da ...

  2. mysql报错 Incorrect table definition;there can be only one auto column and it must be defined as a key

    问题描述:MySQL建时表报错:Incorrect table definition;there can be only one auto column and it must be defined ...

  3. MySQL报错:SQL错误[1146][42s02]: Table 'tablename' doesn't exist(记一次以为自己删库的经历)

    先说一下这篇文章包含的知识点:bin_log服务查询,bin_log文件转为SQL文件,MySQL重启,MySQL磁盘不足报错,MySQL表名大小写配置 事情起因: 操作数据库的是我们的萌新妹子,不太 ...

  4. mysql table plugin,MySql报错Table mysql.plugin doesn’t exist的解决方法

    MySql报错Table mysql.plugin doesn't exist的解决方法 一般产生原因是手工更改my.ini的数据库文件存放地址导致的 mysql服务启动时候找不到内置数据库" ...

  5. mysql报错Table ‘xxxx‘ doesn‘t exist

    mysql报错Table 'xxxx' doesn't exist 问题 pear_admin 开源项目的定时任务使用的是 quartz quartz 默认的表初始化脚本都是表明 大写 作者为了表名符 ...

  6. mysql报错-ERROR 1206 (HY000)- The total number of locks exceeds the lock table size-的解决方法

    mysql报错"ERROR 1206 (HY000): The total number of locks exceeds the lock table size"的解决方法 问题 ...

  7. mysql报错:Reading table information for completion of table and column names

    一.前言 在使用命令行打开数据库的时候,报错如标题所示.这里总结记录一下. 二.错误原因 1.锁表的原因 参考链接:https://blog.csdn.net/ssergsw/article/deta ...

  8. Mysql报错Fatal error:Can't open and lock privilege tables

     Mysql报错Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist 安装mysql后 ...

  9. ERROR 1366 (HY000): Incorrect string value......(Mysql报错解决)

    2019.11.29更新:发现了新的解决方法 错误描述 在控制台执行插入操作的时候,Mysql报错ERROR 1366 (HY000): Incorrect string value--插入操作失败, ...

最新文章

  1. UIScrollView 使用
  2. 如此通俗的分布式锁讲解,如果还搞不定那就...
  3. Windows中用运行命令直接启动指定软件的方法
  4. java环境搭建_记一次阿里云服务器Java相关环境搭建的过程
  5. MPAndroidChart 教程:开始 Getting Started
  6. FIneCMS /dayrui/libraries/Chart/ofc_upload_image.php Arbitrary File Upload Vul
  7. redis(9)--数据库
  8. Android 中的LayoutInflater的理解
  9. 介绍OpenHub框架
  10. Pytorch MNIST直接离线加载二进制文件到pytorch
  11. jieba库词频统计_运用jieba库进行词频统计
  12. win7 oracle 冷恢复
  13. [网络安全自学篇] 五十六.i春秋老师分享小白渗透之路及Web渗透技术总结
  14. Python 中文变量名 用中文写 Python
  15. jeecg boot微服务架构图
  16. python 英语词汇_【我爱背单词】用Python提炼3000英语新闻高频词汇
  17. 人工智能会议等级列表
  18. android 倒水动画,Android 模拟圆形水杯倒水的效果
  19. IE不能上网浏览的原因和解决办法
  20. 视频转换成图像序列、图像转换成视频(代码)

热门文章

  1. Web Worker详解
  2. 全国计算机一级 一年中有几次考试
  3. 成绩管理系统(链表)c语言
  4. redis中的hash扩容渐进式rehash过程
  5. [intervention/image]操作图片从未如此简单
  6. STL学习笔记-quene容器(队列)
  7. Flink FileSystem的connector分析
  8. fastadmin 自定义搜索
  9. 以太坊, FOMO3D ,危险的博弈游戏
  10. 个人学习_21.8.12-线性回归部分