在给mysql数据库备份时,报错:

mysqldump: Got error: 145: Table '.\shengdaxcom\pre_forum_thread' is marked as c
rashed and should be repaired when using LOCK TABLES

如上错误的解决方法如下:
1、进入数据库对该表进行检测:

mysql> check tables pre_forum_thread;
+------------------------------+-------+----------+-----------------------------
--------------------------+
| Table | Op | Msg_type | Msg_text
|
+------------------------------+-------+----------+-----------------------------
--------------------------+
| shengdaxcom.pre_forum_thread | check | warning | Table is marked as crashed
|
| shengdaxcom.pre_forum_thread | check | warning | 1 client is using or hasn't
closed the table properly |
| shengdaxcom.pre_forum_thread | check | error | Size of indexfile is: 845824
Should be: 846848 |
| shengdaxcom.pre_forum_thread | check | error | Corrupt
|
+------------------------------+-------+----------+-----------------------------
--------------------------+
4 rows in set (0.06 sec)

2、使用repair解决方法:

mysql> repair tables pre_forum_thread;
+------------------------------+--------+----------+----------+
| Table | Op | Msg_type | Msg_text |
+------------------------------+--------+----------+----------+
| shengdaxcom.pre_forum_thread | repair | status | OK |
+------------------------------+--------+----------+----------+
1 row in set (0.31 sec)

再次进行dump备份就可以了。

其他参考:

只要在mysqldump的时候加上--lock-tables=false就可以解决问题。
mysqldump -u root -pMyPassword DbName --lock-tables=false > data.sql

在给mysql数据库备份时,报错: mysqldump: Got error: 145: Table '.\shengdaxcom\pre_forum_thread' is marked as c rashed and should be repaired when using LOCK TABLES的更多相关文章

  1. mysql数据库导出时报错mysqldump: Got error: 145的解决方法

      在给mysql数据库备份时,报错:mysqldump: Got error: 145: Table './jxzhtopenfire/ofoffline' is marked as crashed ...

  2. 访问远程mysql数据库,出现报错,显示“1130 - Host'xxx.xxx.xxx.xxx' is not allowed to connect to this MySQL server“

    在使用Navicat for MySQl访问远程mysql数据库,出现报错,显示“1130 - Host'xxx.xxx.xxx.xxx' is not allowed to connect to t ...

  3. django2.0+连接mysql数据库迁移时候报错

    django2.0+连接mysql数据库迁移时候报错 情况一 错误信息 django.core.exceptions.ImproperlyConfigured: mysqlclient 1.3.13 ...

  4. mac系统中搭建apache+mysql+php的开发环境,安装mysql后,登录报错:mac ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

    php新手在mac系统中搭建apache+mysql+php的开发环境(按照这篇博客来操作的:http://my.oschina.net/joanfen/blog/171109?fromerr=xvC ...

  5. mysql数据库备份及恢复命令mysqldump,source的用法

    还原一个数据库:mysql -h localhost -u root -p123456 www<c:/www.sql 备份一个数据库:mysqldump -h localhost -u root ...

  6. 最近使用Navicat for MySQl访问远程mysql数据库,出现报错,显示“2003- Can't connect MySQL Server on 'localhost'(10038)“。

    优先考虑mysql数据库是否开启 1.先看报错窗口.   通过百度,最终找到的原因是:远程3306端口未对外开放. 于是下面进行远程3306端口开放操作.   首先远程连接服务器,点击“开始”-“管理 ...

  7. ubuntu系统中出现mysql数据库无法启动报错2002该怎么处理,具体报错信息如正文所示

    python@ubuntu:~$ mysql -uroot -pmysqlmysql: [Warning] Using a password on the command line interface ...

  8. 远程测试mysql数据库3306端口报错

    错误现象:[root@localhost ~]# telnet 192.168.10.130 3306Trying 192.168.10.130...Connected to 192.168.10.1 ...

  9. MySql数据库 主从复制/共享 报错

    从 获取不到 共享主的数据, 错误信息: Waiting for master to send event 解决方案: // 1. 从V表获取PrNo的数据 select * from Vendor_ ...

随机推荐

  1. Linux 设备驱动的固件加载【转】

    转自:http://blog.csdn.net/zqixiao_09/article/details/51106663 版权声明:本文为博主原创文章,未经博主允许不得转载. 作为一个驱动作者, 你可能 ...

  2. LeetCode OJ——Minimum Depth of Binary Tree

    http://oj.leetcode.com/problems/minimum-depth-of-binary-tree/ 贡献了一次runtime error,因为如果输入为{}即空的时候,出现了c ...

  3. 重新实践《轻量级DJANGO》这本书

    从手到尾,手写的DJANGO,不借助命令,效果一样的呢. import os import sys import hashlib from django.conf import settings DE ...

  4. Codeforces 946 A.Partition

    随便写写,然后写D的题解. A. Partition   time limit per test 1 second memory limit per test 256 megabytes input ...

  5. Codeforces Gym 100338H High Speed Trains 组合数学+dp+高精度

    原题链接:http://codeforces.com/gym/100338/attachments/download/2136/20062007-winter-petrozavodsk-camp-an ...

  6. Maven添加坐标(依赖)及在Eclipse中的操作

    例如:添加一个spring-test.jar的依赖过程,普遍的做法就是直接操作pom.xml文件. 1.打开maven的中央仓库:http://search.maven.org/ 2.搜索仓库: 进入 ...

  7. SQL Server 存储

    http://baoqiangwang.blog.51cto.com/1554549/541298/

  8. InnoDB: Warning: a long semaphore wait 解决办法

    http://blog.csdn.net/wulantian/article/details/37560849

  9. ios构造和析构

    遵循规则: 构造先父类后子类 析构先子类后父类 所以,自定义的init函数需要首先[super init....] dealloc中[super dealloc]却是放在最后的 - (id)initW ...

  10. mysql_config_editor使用简介

      原文 : http://blog.itpub.net/29773961/viewspace-1817640/   ----------------------------------------- ...