在给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. CodeForces 141E: ...(最小生成树)

    [条件转换] 两两之间有且只有一条简单路径<==>树 题意:一个图中有两种边,求一棵生成树,使得这棵树中的两种边数量相等. 思路: 可以证明,当边的权是0或1时,可以生成最小生成树到最大生 ...

  2. LightOJ 1140: How Many Zeroes? (数位DP)

    当前数位DP还不理解的点: 1:出口用i==0的方式 2:如何省略状态d(就是枚举下一个数的那个状态.当然枚举还是要的,怎么把空间省了) 总结: 1:此类DP,考虑转移的时候,应当同时考虑查询时候的情 ...

  3. kswapd0 进程 设置 swap

    kswapd0是虚拟内存管理中,负责换页,说白了就是你的物理内存不够用了 现在的服务器,一般内存都很高,所有很少使用 swap 分区了   这时候考虑的两种处理办法 加大物理内存 或者 增加swap分 ...

  4. jquery鼠标点击窗口或浮动层以外关闭层【阻止冒泡事件】

    $(".up-list a.th1").click(function(){ $(this).next("ul#up-list-ul").show(); }); ...

  5. Codeforces 895E Eyes Closed(线段树)

    题目链接  Eyes Closed 题意  两个人玩一个游戏,现在有两种操作: 1.两个人格子挑选一个区间,保证两个的区间不相交.在这两个区间里面各选出一个数,交换这两个数. 2.挑选一个区间,求这个 ...

  6. bzoj 1453: [Wc]Dface双面棋盘

    1453: [Wc]Dface双面棋盘 Time Limit: 10 Sec  Memory Limit: 64 MBSubmit: 617  Solved: 317[Submit][Status][ ...

  7. Loj #125. 除数函数求和(2)

    link : https://loj.ac/problem/125 分块calc即可. #include<bits/stdc++.h> #define ll long long using ...

  8. 谈谈 ServletConfig 和 ServletContext

    目录 一.ServletConfig 和 ServletContext 的概念 二.ServletConfig 和 SerlvetContext 代码表示 一.ServletConfig 和 Serv ...

  9. 【matlab】:matlab中不断的出现计算过程怎么办

    这个问题是会常常性出的.就是matlab中不断的出现计算. 关于这个问题,我们须要考虑的是自己是不是写错了,通常会出现以下两种可能的错误 1,关于计算的函数没有写分号 :这样的是致命问题,假设函数不写 ...

  10. 21. Spring Boot过滤器、监听器【从零开始学Spring Boot】

    转载:http://blog.csdn.net/linxingliang/article/details/52069490 上一篇文章已经对定义Servlet 的方法进行了说明,过滤器(Filter) ...