Incorrect key file for table解决方法

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

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,如需转载请自行联系原作者
相关实践学习
基于CentOS快速搭建LAMP环境
本教程介绍如何搭建LAMP环境,其中LAMP分别代表Linux、Apache、MySQL和PHP。
全面了解阿里云能为你做什么
阿里云在全球各地部署高效节能的绿色数据中心,利用清洁计算为万物互联的新世界提供源源不断的能源动力,目前开服的区域包括中国(华北、华东、华南、香港)、新加坡、美国(美东、美西)、欧洲、中东、澳大利亚、日本。目前阿里云的产品涵盖弹性计算、数据库、存储与CDN、分析与搜索、云通信、网络、管理与监控、应用服务、互联网中间件、移动服务、视频服务等。通过本课程,来了解阿里云能够为你的业务带来哪些帮助 &nbsp; &nbsp; 相关的阿里云产品:云服务器ECS 云服务器 ECS(Elastic Compute Service)是一种弹性可伸缩的计算服务,助您降低 IT 成本,提升运维效率,使您更专注于核心业务创新。产品详情: https://www.aliyun.com/product/ecs
目录
相关文章
|
2月前
|
关系型数据库 MySQL
MySQL 报错 [ERROR] [FATAL] InnoDB: Table flags are 0 in the data dictionary but the flags in file
MySQL 报错 [ERROR] [FATAL] InnoDB: Table flags are 0 in the data dictionary but the flags in file
566 0
|
1月前
Duplicate keys detected: '0'原因及解决方法
Duplicate keys detected: '0'原因及解决方法
|
1月前
|
关系型数据库 MySQL 数据库
Error: Table ‘bWAPP.users‘ doesn‘t exist
Error: Table ‘bWAPP.users‘ doesn‘t exist
11 0
|
存储 关系型数据库 MySQL
超详细!Mysql错误1452 - Cannot add or update a child row: a foreign key constraint fails 原因及解决方法
超详细!Mysql错误1452 - Cannot add or update a child row: a foreign key constraint fails 原因及解决方法
2627 0
超详细!Mysql错误1452 - Cannot add or update a child row: a foreign key constraint fails 原因及解决方法
解决Only void and foreign elements can be self closed “ xxxx-xxxx“报错
解决Only void and foreign elements can be self closed “ xxxx-xxxx“报错
解决Only void and foreign elements can be self closed “ xxxx-xxxx“报错
|
SQL 关系型数据库 MySQL
[Err] 1294 - Invalid ON UPDATE clause for 'comment_time' column【详细解决办法】
[Err] 1294 - Invalid ON UPDATE clause for 'comment_time' column【详细解决办法】
668 0
[Err] 1294 - Invalid ON UPDATE clause for 'comment_time' column【详细解决办法】
|
SQL
ORA-02292: integrity constraint (xxxx) violated - child record found
在更新表的主键字段或DELETE数据时,如果遇到ORA-02292: integrity constraint (xxxx) violated - child record found 这个是因为主外键关系,下面借助一个小列子来描述一下这个错误: SQL> create table studen...
2240 0