表'./mysql/proc'被标记为崩溃,应该修复

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/31139397/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-31 21:08:23  来源:igfitidea点击:

Table './mysql/proc' is marked as crashed and should be repaired

mysqldatabasecrash

提问by Srikanth A

When i perform any procedure creation or update operation to mysql DB, i am getting the below error

当我对 mysql DB 执行任何过程创建或更新操作时,我收到以下错误

Table './mysql/proc' is marked as crashed and should be repaired

表'./mysql/proc'被标记为崩溃,应该修复

Tried to run mysql isam recover using below command - myisamchk -q -r /var/lib/mysql/mysql/proc

尝试使用以下命令运行 mysql isam recovery - myisamchk -q -r /var/lib/mysql/mysql/proc

But the issue still persists.

但问题仍然存在。

Thanks in Advance.

提前致谢。

回答by HashSu

Try these:

试试这些:

mysqlcheck --auto-repair -A -u username -ppassword

Inside MySQL terminal

MySQL终端内部

repair table mysql.proc;

Reference: https://dev.mysql.com/doc/refman/5.1/en/repair-table.htmlModify the my.cnf

参考:https: //dev.mysql.com/doc/refman/5.1/en/repair-table.html修改my.cnf

[mysqld]
character-sets-dir=/usr/share/mysql/charsets

Reference: http://dev.mysql.com/doc/refman/5.0/en/repair-table.html

参考:http: //dev.mysql.com/doc/refman/5.0/en/repair-table.html

回答by Srikanth A

The above answer also applicable to other business related tables -

以上答案也适用于其他业务相关的表格——

example - Table './dev/bank_accounts' is marked as crashed and should be repaired

示例 - 表“./dev/bank_accounts”被标记为崩溃,应该修复

Can be resolved by following command in mysql prompt.

可以通过在 mysql 提示符下执行以下命令来解决。

repair table 'dev.bank_accounts';

Internally, mysql trys to recover the data from MyISAM storage engine of mysql.

在内部,mysql 尝试从 mysql 的 MyISAM 存储引擎中恢复数据。

Caution - Please take a back up of the table before doing a repair, As the repair might cause a data loss.

注意 - 请在进行修复前备份表,因为修复可能会导致数据丢失。