Incorrect key file for table解决方法

本文涉及的产品
云数据库 RDS MySQL,集群系列 2核4GB
推荐场景:
搭建个人博客
RDS MySQL Serverless 基础系列,0.5-2RCU 50GB
云数据库 RDS MySQL,高可用系列 2核4GB
简介:

org.springframework.dao.DataIntegrityViolationException: SqlMapClient operation; SQL [];
--- The error occurred in sql/Scene.xml.
--- The error occurred while applying a parameter map.
--- Check the insertBoxLogTmp-InlineParameterMap.
--- Check the statement (update failed).
--- Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry '2607-200305' for key 'PRIMARY'; nested exception is com.ibatis.common.jdbc.exception.NestedSQLException:
--- The error occurred in sql/Scene.xml.
--- The error occurred while applying a parameter map.
--- Check the insertBoxLogTmp-InlineParameterMap.
--- Check the statement (update failed).
--- Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry '2607-200305' for key 'PRIMARY'
Caused by: com.ibatis.common.jdbc.exception.NestedSQLException:
--- The error occurred in sql/Scene.xml.
--- The error occurred while applying a parameter map.
--- Check the insertBoxLogTmp-InlineParameterMap.
--- Check the statement (update failed).
--- Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry '2607-200305' for key 'PRIMARY'
at com.ibatis.sqlmap.engine.mapping.statement.MappedStatement.executeUpdate(MappedStatement.java:107)
at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.insert(SqlMapExecutorDelegate.java:393)
at com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.insert(SqlMapSessionImpl.java:82)
at org.springframework.orm.ibatis.SqlMapClientTemplate$9.doInSqlMapClient(SqlMapClientTemplate.java:370)
at org.springframework.orm.ibatis.SqlMapClientTemplate.execute(SqlMapClientTemplate.java:194)
at org.springframework.orm.ibatis.SqlMapClientTemplate.insert(SqlMapClientTemplate.java:368)
at com.manu.tarot.dao.SceneDao.insertBoxLogTmp(SceneDao.java:151)
at com.manu.tarot.service.BoxService.insertBoxLogTmp(BoxService.java:94)
at com.manu.tarot.service.BoxService$$FastClassByCGLIB$$dbf8e40d.invoke(<generated>)
at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)

查看mysql error日志, 提示一张日志表损坏,需要修复

091120 16:40:50 [ERROR] /usr/sbin/mysqld: Incorrect key file for table './sword/Sword_log.MYI'; try to repair it

停掉相关服务,冷备数据库后,执行check table Sword_log及repair table Sword_log后恢复。










本文转自 trt2008 51CTO博客,原文链接:http://blog.51cto.com/chlotte/376244,如需转载请自行联系原作者
相关实践学习
如何快速连接云数据库RDS MySQL
本场景介绍如何通过阿里云数据管理服务DMS快速连接云数据库RDS MySQL,然后进行数据表的CRUD操作。
全面了解阿里云能为你做什么
阿里云在全球各地部署高效节能的绿色数据中心,利用清洁计算为万物互联的新世界提供源源不断的能源动力,目前开服的区域包括中国(华北、华东、华南、香港)、新加坡、美国(美东、美西)、欧洲、中东、澳大利亚、日本。目前阿里云的产品涵盖弹性计算、数据库、存储与CDN、分析与搜索、云通信、网络、管理与监控、应用服务、互联网中间件、移动服务、视频服务等。通过本课程,来了解阿里云能够为你的业务带来哪些帮助 &nbsp; &nbsp; 相关的阿里云产品:云服务器ECS 云服务器 ECS(Elastic Compute Service)是一种弹性可伸缩的计算服务,助您降低 IT 成本,提升运维效率,使您更专注于核心业务创新。产品详情: https://www.aliyun.com/product/ecs
目录
相关文章
|
8月前
Duplicate keys detected: '0'原因及解决方法
Duplicate keys detected: '0'原因及解决方法
|
JavaScript
Invalid char (/) found at index (10) in sheet name异常原因|导出excel出现Invalid char (/) found at index (10)
Invalid char (/) found at index (10) in sheet name异常原因|导出excel出现Invalid char (/) found at index (10)
|
SQL 关系型数据库 MySQL
[Err] 1294 - Invalid ON UPDATE clause for 'comment_time' column【详细解决办法】
[Err] 1294 - Invalid ON UPDATE clause for 'comment_time' column【详细解决办法】
765 0
[Err] 1294 - Invalid ON UPDATE clause for 'comment_time' column【详细解决办法】
|
JavaScript
vue的报错信息:Duplicate keys detected: ‘0‘. This may cause an update error.
vue的报错信息:Duplicate keys detected: ‘0‘. This may cause an update error.
480 0
|
SQL 关系型数据库
ORA-1652: unable to extend temp segment by 128 in tablespace xxx Troubleshootin
当收到告警信息ORA-01652: unable to extend temp segment by 128 in tablespace xxxx 时,如何Troubleshooting ORA-1652这样的问题呢? 当然一般xxx是临时表空间,也有可能是用户表空间。
2121 0