mysql断电修复_MySQL断电恢复的一点简单分析

system logsequencenumber 1626124.

InnoDB: Your databasemay be corruptoryou may have copied the InnoDB

InnoDB: tablespace but notthe InnoDB log files. See

InnoDB: http://dev.mysql.com/doc/refman/5.6/en/forcing-innodb-recovery.html

InnoDB: formore information.

这个问题今朝的影响范围其实还不明显,因为尽管如斯,我们照样可以或许写入数据的。

关于崩溃恢复,有一个数据参淑匀其须要留意,那就是innodb_force_recovery,这个参数默认值为0,如不雅为非0的值(范围为1-6),会有下面的影响范围。mysql>insertintotestvalues(1,'a');

Query OK, 1 row affected (0.04 sec)

mysql> select*fromtest;

+----+------+

| id | name|

+----+------+

| 1 | a |

+----+------+

1 row inset(0.00 sec)

1 (SRV_FORCE_IGNORE_CORRUPT): 忽视检查到的corrupt页。

2 (SRV_FORCE_NO_BACKGROUND): 阻拦主线程的运行,如主线程须要履行full purge操作,会导致crash。

3 (SRV_FORCE_NO_TRX_UNDO): 不履行事务回滚操作。

4 (SRV_FORCE_NO_IBUF_MERGE): 不履行插入缓冲的归并操作。

5 (SRV_FORCE_NO_UNDO_LOG_SCAN):不查看重做日记,InnoDB存储引擎会将未提交的事务视为已提交。

6 (SRV_FORCE_NO_LOG_REDO): 不履行前滚的操作。

对于这个问题,在一些断电的场景下照样可能出现的。我起首是要确认是否为线上营业照样测试情况,线上营业来嗣魅这个影响照样很大年夜的。如不雅数据库无法启动,重要义务照样把数据库启动,然后在这个基本上查看损掉的数据程度,安排数据修复的事宜。mysql>setglobalinnodb_force_recovery=2;

ERROR 1238 (HY000): Variable 'innodb_force_recovery'isareadonlyvariable

在此假设我们设置为2,再次复现这个问题问题,你就会发明,数据库临时是可以启动的,然则数据只能萌芽,DML操作都邑抛错。mysql>select*fromtest;

Empty set(0.00 sec)

mysql>

mysql> insertintotestvalues(1,'a');

ERROR 1030 (HY000): Got error -1 fromstorage engine

推荐阅读

在Ignite大年夜会上,微软列出了将改变科技家当的3项关键技巧,分别是混淆实际、人工智能和量子计算。微软在移动时代错掉了影响力,这是毋庸置疑的,然则它正在尽力弥补。如不雅大年夜家日常平凡比较存>>>详细阅读

地址:http://www.17bianji.com/lsqh/37624.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
处理一下出现的日志 Plugin 'FEDERATED' is disabled. 2017-11-15 19:23:46 16c0 InnoDB: Warning: Using innodb_additional_mem_pool_size is DEPRECATED. This option may be removed in future releases, together with the option innodb_use_sys_malloc and with the InnoDB's internal memory allocator. 2017-11-15 19:23:46 1404 [Note] InnoDB: Using atomics to ref count buffer pool pages 2017-11-15 19:23:46 1404 [Note] InnoDB: The InnoDB memory heap is disabled 2017-11-15 19:23:46 1404 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions 2017-11-15 19:23:46 1404 [Note] InnoDB: Memory barrier is not used 2017-11-15 19:23:46 1404 [Note] InnoDB: Compressed tables use zlib 1.2.3 2017-11-15 19:23:46 1404 [Note] InnoDB: Not using CPU crc32 instructions 2017-11-15 19:23:46 1404 [Note] InnoDB: Initializing buffer pool, size = 9.0G 2017-11-15 19:23:46 1404 [Note] InnoDB: Completed initialization of buffer pool 2017-11-15 19:23:46 1404 [Note] InnoDB: Highest supported file format is Barracuda. 2017-11-15 19:23:46 1404 [Note] InnoDB: Log scan progressed past the checkpoint lsn 9219742510 2017-11-15 19:23:46 1404 [Note] InnoDB: Database was not shutdown normally! 2017-11-15 19:23:46 1404 [Note] InnoDB: Starting crash recovery. 2017-11-15 19:23:46 1404 [Note] InnoDB: Reading tablespace information from the .ibd files... 2017-11-15 19:23:46 1404 [Note] InnoDB: Restoring possible half-written data pages 2017-11-15 19:23:46 1404 [Note] InnoDB: from the doublewrite buffer... InnoDB: Doing recovery: scanned up to log sequence number 9219763629 InnoDB: 1 transaction(s) which must be rolled back or cleaned up InnoDB: in total 0 row operations to undo InnoDB: Trx id counter is 275040768 2017-11-15 19:23:47 1404 [Note] InnoDB: Starting an apply batch of log records to the database... InnoDB: Progress in percent: 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值