MySQL 表被标记为崩溃,应该修复

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/4357270/
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 17:54:26  来源:igfitidea点击:

Table is marked as crashed and should be repaired

mysqldatabasewordpress

提问by John Connor

I am getting this error in wordpress phpMyadmin

我在 wordpress phpMyadmin 中收到此错误

#145 - Table './DB_NAME/wp_posts' is marked as crashed and should be repaired 

When I login to phpMyadmin, it says wp_posts is "in use"

当我登录到 phpMyadmin 时,它说 wp_posts 正在“使用中”

My website is currently down because of this.

由于这个原因,我的网站目前已关闭。

I googled this problem, but I don't see the "repair" button on phpMyadmin. Please let me know how to fix this. I am not sure where to issue PHP command. Please advise, my proficiency with PHP is very basic.

我用谷歌搜索了这个问题,但在 phpMyadmin 上没有看到“修复”按钮。请让我知道如何解决这个问题。我不确定在哪里发出 PHP 命令。请指教,我对 PHP 的熟练程度非常基础。

回答by Nican

Here is where the repair button is:

这是修复按钮的位置:

alt text

替代文字

回答by tylerl

Run this from your server's command line:

从服务器的命令行运行:

 mysqlcheck --repair --all-databases

回答by Arun Killu

I had the same issue when my server free disk space available was 0

当我的服务器可用磁盘空间为 0 时,我遇到了同样的问题

You can use the command (there must be ample space for the mysql files)

您可以使用该命令(mysql文件必须有足够的空间)

REPAIR TABLE `<table name>`;

for repairing individual tables

用于修复单个表

回答by Nedudi

Connect to your server via SSH

通过 SSH 连接到您的服务器

then connect to your mysql console

然后连接到你的 mysql 控制台

and

USE user_base
REPAIR TABLE TABLE;

-OR-

-或者-

If there are a lot of broken tables in current database:

如果当前数据库中有很多损坏的表:

mysqlcheck -uUSER -pPASSWORD  --repair --extended user_base

If there are a lot of broken tables in a lot of databases:

如果很多数据库中有很多坏表:

mysqlcheck -uUSER -pPASSWORD  --repair --extended -A

回答by RasoolLotfi

When I got this error:

当我收到此错误时:

#145 - Table '.\engine\phpbb3_posts' is marked as crashed and should be repaired

#145 - 表 '.\engine\phpbb3_posts' 被标记为崩溃,应该修复

I ran this command in PhpMyAdmin to fix it:

我在 PhpMyAdmin 中运行这个命令来修复它:

REPAIR TABLE phpbb3_posts;

回答by Dmitri

This means your MySQL table is corrupted and you need to repair it. Use

这意味着您的 MySQL 表已损坏,您需要修复它。用

myisamchk -r /DB_NAME/wp_posts

from the command line. While you running the repair you should shut down your website temporarily so that no new connections are attempted to your database while its being repaired.

从命令行。在运行修复时,您应该暂时关闭您的网站,以便在修复时不会尝试连接到您的数据库。