1194: Table 'name' is marked as crashed and should be repaired(表 'name' 被标记为已崩溃,应当修复)
MySQL含义
一张通常使用 MyISAM 引擎存储的表(MariaDB 中也包括 Aria)被标记为损坏/崩溃,在修复之前无法使用。访问该表的查询会以此错误失败。
原因
在服务器突然崩溃/断电、磁盘写满、硬件故障或 mysqld 进程被终止时,MyISAM 表未被正常关闭。由于 MyISAM 不提供事务和崩溃安全,这种情况比 InnoDB 频繁得多。
解决方法
修复表:REPAIR TABLE table_name; 或离线使用 myisamchk -r。修复前务必备份数据文件。作为永久方案,将表迁移到 InnoDB:ALTER TABLE my_table ENGINE=InnoDB; 使其具备崩溃安全性。检查磁盘健康状况和 myisam_recover_options 设置。
同一数据库的其他条目
- 1206The total number of locks exceeds the lock table size(锁的总数超过了锁表大小)
- 1236Got fatal error 1236 from master when reading data from binary log(从 master 读取二进制日志数据时收到致命错误 1236)
- 1129Host 'host' is blocked because of many connection errors(主机 'host' 因连接错误过多而被阻止)
- 1615Prepared statement needs to be re-prepared(预处理语句需要重新准备)
- 1553Cannot drop index needed in a foreign key constraint(无法删除外键约束所需的索引)
- 3948Loading local data is disabled; this must be enabled on both the client and server sides(加载本地数据已禁用;必须在客户端和服务器端同时启用)
- 1075Incorrect table definition; there can be only one auto column and it must be defined as a key(表定义不正确;只能有一个自增列,且必须将其定义为键)