Incorrect key file for table解决方法-阿里云开发者社区

开发者社区> 数据库> 正文

Incorrect key file for table解决方法

简介:

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,如需转载请自行联系原作者

版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。

分享:
数据库
使用钉钉扫一扫加入圈子
+ 订阅

分享数据库前沿,解构实战干货,推动数据库技术变革

其他文章