我将我的网站置于维护状态,这样就没有人可以访问它,也不会有新数据进入数据库。我正在运行一个查询,以从表中删除 3 个月前的旧数据,这花了将近一个小时的时间,我试图停止它,但没有成功,所以我MySQLd.exe
通过进程管理器终止了它。
当我尝试再次启动服务器时,它却无法启动。服务显示starting...
我检查了日志,发现 InnoDB 正在尝试恢复因崩溃而导致的数据。但它也花了太长时间,几乎已经 3 个小时了,仍然没有任何结果。
我从中删除数据的表是日志表,我可以忍受丢失所有数据。
有没有办法强制启动 Mysql?
我的日志供参考:(这是我刚刚停止并重新启动 MySQL 的新日志)
2018-09-28 23:01:13 1236 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions
2018-09-28 23:01:13 1236 [Note] InnoDB: Uses event mutexes
2018-09-28 23:01:13 1236 [Note] InnoDB: Compressed tables use zlib 1.2.3
2018-09-28 23:01:13 1236 [Note] InnoDB: Number of pools: 1
2018-09-28 23:01:13 1236 [Note] InnoDB: Using generic crc32 instructions
2018-09-28 23:01:13 1236 [Note] InnoDB: Initializing buffer pool, total size = 26G, instances = 8, chunk size = 128M
2018-09-28 23:01:15 1236 [Note] InnoDB: Completed initialization of buffer pool
2018-09-28 23:01:15 1236 [Note] InnoDB: Highest supported file format is Barracuda.
2018-09-28 23:01:15 1236 [Note] InnoDB: Starting crash recovery from checkpoint LSN=778232557473
2018-09-28 23:01:29 1236 [Note] InnoDB: Read redo log up to LSN=778281119232
2018-09-28 23:01:45 1236 [Note] InnoDB: To recover: 72237 pages from log
2018-09-28 23:05:48 1236 [Note] InnoDB: 1 transaction(s) which must be rolled back or cleaned up in total 16171495 row operations to undo
2018-09-28 23:05:48 1236 [Note] InnoDB: Trx id counter is 678379008
2018-09-28 23:05:48 1236 [Note] InnoDB: Starting final batch to recover 69592 pages from redo log.
2018-09-28 23:05:48 17120 [Note] InnoDB: To recover: 69591 pages from log
2018-09-28 23:06:03 17120 [Note] InnoDB: To recover: 65851 pages from log
2018-09-28 23:06:17 10180 [Note] InnoDB: To recover: 61926 pages from log
2018-09-28 23:06:32 11776 [Note] InnoDB: To recover: 57757 pages from log
2018-09-28 23:06:47 10180 [Note] InnoDB: To recover: 53071 pages from log
2018-09-28 23:07:02 11776 [Note] InnoDB: To recover: 48887 pages from log
2018-09-28 23:07:17 12348 [Note] InnoDB: To recover: 45023 pages from log
2018-09-28 23:07:33 12348 [Note] InnoDB: To recover: 41053 pages from log
2018-09-28 23:07:47 11776 [Note] InnoDB: To recover: 36623 pages from log
2018-09-28 23:08:02 12348 [Note] InnoDB: To recover: 32688 pages from log
2018-09-28 23:08:17 17120 [Note] InnoDB: To recover: 29057 pages from log
2018-09-28 23:08:32 17120 [Note] InnoDB: To recover: 24964 pages from log
2018-09-28 23:08:47 12348 [Note] InnoDB: To recover: 21520 pages from log
2018-09-28 23:09:02 12348 [Note] InnoDB: To recover: 18192 pages from log
2018-09-28 23:09:17 17120 [Note] InnoDB: To recover: 15020 pages from log
2018-09-28 23:09:32 10180 [Note] InnoDB: To recover: 11971 pages from log
2018-09-28 23:09:47 11776 [Note] InnoDB: To recover: 8775 pages from log
2018-09-28 23:10:03 17120 [Note] InnoDB: To recover: 5464 pages from log
2018-09-28 23:10:17 11776 [Note] InnoDB: To recover: 1857 pages from log
2018-09-28 23:10:26 1236 [Note] InnoDB: Last binlog file 'C:\Program Files\MariaDB 10.2\data\mysql-bin.000578', position 1720
2018-09-28 23:10:27 1236 [Note] InnoDB: 128 out of 128 rollback segments are active.
2018-09-28 23:10:27 22188 [Note] InnoDB: Starting in background the rollback of recovered transactions
2018-09-28 23:10:27 22188 [Note] InnoDB: Rolling back trx with id 678377419, 16171495 rows to undo
2018-09-28 23:10:27 1236 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
InnoDB: Progress in percents: 12018-09-28 23:10:27 1236 [Note] InnoDB: Creating shared tablespace for temporary tables
2018-09-28 23:10:27 1236 [Note] InnoDB: Setting file '.\ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2018-09-28 23:10:27 1236 [Note] InnoDB: File '.\ibtmp1' size is now 12 MB.
2018-09-28 23:10:27 1236 [Note] InnoDB: Waiting for purge to start
2018-09-28 23:10:27 1236 [Note] InnoDB: 5.7.19 started; log sequence number 778528084534
2018-09-28 23:10:27 8332 [Note] InnoDB: Loading buffer pool(s) from C:\Program Files\MariaDB 10.2\data\ib_buffer_pool
...lots of more data... and lots of long semaphore wait
InnoDB: ###### Starts InnoDB Monitor for 30 secs to print diagnostic info:
InnoDB: Pending reads 0, writes 0
InnoDB: ###### Diagnostic info printed to the standard error stream
2018-09-28 23:25:07 8332 [Note] InnoDB: Buffer pool(s) load completed at 180928 23:25:07
我注意到了这一行:
InnoDB: Rolling back trx with id 678377419, 16171495 rows to undo
我试图从日志表中删除的实际行数约为 1600 万行。