关于myisam_recover_options参数:https://dev.mysql.com/doc/refman/8.0/en/myisam-start.html

设置MyISAM存储引擎的恢复模式。变量值是OFF、DEFAULT、BACKUP、FORCE或QUICK值的任意组合。如果指定多个值,则用逗号分隔。在服务器启动时指定不带值的变量与指定DEFAULT相同,并且指定显式值“”禁用恢复(与值OFF相同)。如果启用了恢复,那么每次mysqld打开MyISAM表时,它会检查表是否被标记为崩溃或没有被正确关闭。(最后一个选项只在禁用外部锁定的情况下运行。)如果是这种情况,mysqld会对表进行检查。如果表被损坏,mysqld尝试修复它。

Automatic recovery is activated if you start mysqld with the myisam_recover_options system variable set. In this case, when the server opens a MyISAM table, it checks whether the table is marked as crashed or whether the open count variable for the table is not 0 and you are running the server with external locking disabled. If either of these conditions is true, the following happens:https://www.cndba.cn/hbhe0316/article/22614

The server checks the table for errors.https://www.cndba.cn/hbhe0316/article/22614

If the server finds an error, it tries to do a fast table repair (with sorting and without re-creating the data file).

https://www.cndba.cn/hbhe0316/article/22614

If the repair fails because of an error in the data file (for example, a duplicate-key error), the server tries again, this time re-creating the data file.

If the repair still fails, the server tries once more with the old repair option method (write row by row without sorting). This method should be able to repair any type of error and has low disk space requirements.

https://www.cndba.cn/hbhe0316/article/22614
https://www.cndba.cn/hbhe0316/article/22614
https://www.cndba.cn/hbhe0316/article/22614

If the recovery wouldn’t be able to recover all rows from previously completed statements and you didn’t specify FORCE in the value of the myisam_recover_options system variable, automatic repair aborts with an error message in the error log:

Error: Couldn't repair table: test.g00pages

If you specify FORCE, a warning like this is written instead:https://www.cndba.cn/hbhe0316/article/22614

Warning: Found 344 of 354 rows when repairing ./test/g00pages

If the automatic recovery value includes BACKUP, the recovery process creates files with names of the form tbl_name-datetime.BAK. You should have a cron script that automatically moves these files from the database directories to backup media.https://www.cndba.cn/hbhe0316/article/22614

1.修改/etc/mysql.cnf文件https://www.cndba.cn/hbhe0316/article/22614https://www.cndba.cn/hbhe0316/article/22614

[root@mysql57 ~]# cat /etc/my.cnf | grep -i myisam_recover_options
myisam_recover_options = FORCE,BACKUP
[root@mysql57 ~]# service mysqld restart
Shutting down MySQL... SUCCESS!
Starting MySQL. SUCCESS!

2.查看是否设置生效

mysql> SHOW VARIABLES LIKE 'myisam_recover_options';
+------------------------+--------------+
| Variable_name          | Value        |
+------------------------+--------------+
| myisam_recover_options | BACKUP,FORCE |
+------------------------+--------------+
1 row in set (0.00 sec)

版权声明:本文为博主原创文章,未经博主允许不得转载。

MYSQL

Mysql myisam_recover_options参数相关推荐

  1. MySQL配置文件mysql.ini参数详解

    my.ini(Linux系统下是my.cnf),当mysql服务器启动时它会读取这个文件,设置相关的运行环境参数. my.ini分为两块:Client Section和Server Section. ...

  2. mysql配置参数调优(8GB内存和64GB内存)

    文章目录 一.前言 二.查看服务器的CPU和内存 1.查看CPU的个数 2.查看服务器的内存 3.数据库版本 三.64GB内存的mysql配置参数 四.本机8GB内存的mysql配置参数 1.查看数据 ...

  3. mysql key_block_size_Mysql入门mysql Key_buffer_size参数的优化设置

    <Mysql入门mysql Key_buffer_size参数的优化设置>要点: 本文介绍了Mysql入门mysql Key_buffer_size参数的优化设置,希望对您有用.如果有疑问 ...

  4. shell编程系列23--shell操作数据库实战之mysql命令参数详解

    shell编程系列23--shell操作数据库实战之mysql命令参数详解mysql命令参数详解-u 用户名-p 用户密码-h 服务器ip地址-D 连接的数据库-N 不输出列信息-B 使用tab键代替 ...

  5. MySQL服务器参数介绍

    前面介绍了服务器硬件,操作系统,和数据库引擎对数据库性能的影响,现在我们再来看看,MYSQL服务器配置,是如何影响MYSQL性能的,大家知道,MYSQL有大量可以修改的参数,以我们演示的MYSQL系统 ...

  6. mysql --skip-locking_skip-external-locking – MySQL性能参数详解

    skip-external-locking – MySQL性能参数详解 MySQL的配置文件my.cnf中默认存在一行skip-external-locking的参数,即"跳过外部锁定&qu ...

  7. mysql.ini环境配置_MySQL配置文件mysql.ini参数详解

    my.ini(Linux系统下是my.cnf),当mysql服务器启动时它会读取这个文件,设置相关的运行环境参数. my.ini分为两块:Client Section和Server Section. ...

  8. mysql参数配置详情_MySQL配置文件mysql.ini参数详解、MySQL性能优化

    类型:数据库类大小:1.7M语言:英文 评分:6.6 标签: 立即下载 my.ini(Linux系统下是my.cnf),当mysql服务器启动时它会读取这个文件,设置相关的运行环境参数. my.ini ...

  9. MySQL高级-MySQL并发参数调整

    Mysql并发参数调整 1 max_connections 2 back_log 3 table_open_cache 4 thread_cache_size 5 innodb_lock_wait_t ...

最新文章

  1. Kubernetes的yaml文件中command的使用
  2. 以下关于java中布局管理说法错误的是_对于 Java 中的布局管理器,以下说法中错误的是( )。_2019复习答案_学小易找答案...
  3. 日志分析利器splunk的搭建、使用、破解
  4. VC++ 获取系统时间的方法汇总
  5. vue 点击渲染ajax,vue中在页面加载时发送ajax请求获取数据渲染不到页面上
  6. Idea加快开发的10个技巧
  7. RocketMQ 一行代码造成大量消息发送失败
  8. Java初学者需掌握的30个概念
  9. A - Divisors POJ - 2992 (组合数C的因子数)数学—大数
  10. 《大话设计模式》笔记2
  11. 用VBA制作Excel单选框和多选框
  12. 闲置eSATA接口影响Windows7启动速度案例分析
  13. 如何提高测试的工作效率?都有哪些具体手段?
  14. iOS越狱系统绕过frida检测
  15. openssl 实现 aes 文件加密解密
  16. putty、xshell小键盘无法输入
  17. Axure RP 10怎么卸载干净,Axure RP 10怎么在注册表卸载清除
  18. activemq-messages-dequeud-but-not-consumed
  19. 【其它】颜色的知识--亮度、色相、饱和度、对比度
  20. Spring Framework 开发参考手册 之十四 JMS支持

热门文章

  1. C# 三张图告诉你什么是Assembly
  2. Audience新降噪技术或整合进iPad3的A6处理器
  3. 如何控制上网行为,空明云上网行为管理软件可以做什么?
  4. windows查看服务器启动日志文件,windows服务器日志查看工具
  5. [答疑]茶叶盒的用例
  6. sklearn进行情感分析
  7. 复试C程序设计(谭浩强版)
  8. CorelDRAW利用表格工具制作表格(二)
  9. 努力、奋斗,写给自己、讲给你听
  10. 标题相似度算法_相似度计算方法