InnoDB: No valid checkpoint found.

ywxj_001發表於2018-12-29
MySQL啟動報錯:
SSOT01:/usr/local/mysql/data>service mysqld restart
MySQL server PID file could not be found!                                                                          failed
Starting MySQL.The server quit without updating PID file (/usr/local/mysql/data/SSOT01.pid).                       failed
檢視err日誌:
SSOT01:/usr/local/mysql/data>tail -100 SSOT01.err
181229 13:32:12 InnoDB: Mutexes and rw_locks use GCC atomic builtins
181229 13:32:12 InnoDB: Compressed tables use zlib 1.2.3
181229 13:32:12 InnoDB: Using Linux native AIO
181229 13:32:12 InnoDB: Initializing buffer pool, size = 1.0G
181229 13:32:12 InnoDB: Completed initialization of buffer pool
181229 13:32:12 InnoDB: highest supported file format is Barracuda.
InnoDB: No valid checkpoint found.
InnoDB: If this error appears when you are creating an InnoDB database,
InnoDB: the problem may be that during an earlier attempt you managed
InnoDB: to create the InnoDB data files, but log file creation failed.
InnoDB: If that is the case, please refer to
InnoDB: http://dev.mysql.com/doc/refman/5.5/en/error-creating-innodb.html
181229 13:32:12 [ERROR] Plugin 'InnoDB' init function returned error.

181229 13:32:12 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.


日誌的錯誤資訊都看了,方法都試了還是不行。

最後的問題關鍵點在這裡:

InnoDB: No valid checkpoint found.

將innodb的ibdata*和ib_logfile*都刪除掉之後,重啟MYSQL,會發現原來的innodb表都丟失了,原因是因為innodb的資料是儲存在ibdata*檔案裡的,
如果保留ibdata*但將ib_logfile*都刪除掉的話,mysql還是啟動不了,會報錯no valid checkpoint found,這是因為innodb是支援事務的,啟動之後,MYSQL需要一些前滾和回滾的操作,
以保證事務的一致性,但ib_logfile*被刪除之後,無法保障事務的一致性,最終結果導致MYSQL無法啟動。
一句話總結:ib_logfile*檔案就是Oracle裡的redolog和archivelog檔案。


解決辦法:刪除innodb的ibdata*和ib_logfile*,然後重啟mysql服務。
不再報錯:


181229 14:55:35 [Note] Plugin 'FEDERATED' is disabled.
181229 14:55:35 InnoDB: The InnoDB memory heap is disabled
181229 14:55:35 InnoDB: Mutexes and rw_locks use GCC atomic builtins
181229 14:55:35 InnoDB: Compressed tables use zlib 1.2.3
181229 14:55:35 InnoDB: Using Linux native AIO
181229 14:55:35 InnoDB: Initializing buffer pool, size = 5.0G
181229 14:55:36 InnoDB: Completed initialization of buffer pool
181229 14:55:36 InnoDB: highest supported file format is Barracuda.
181229 14:55:36  InnoDB: Waiting for the background threads to start
181229 14:55:37 InnoDB: 1.1.8 started; log sequence number 1595675
Thread pool plugin started successfully with parameters:
thread_pool_size = 24,
thread_pool_algorithm = Low Concurrency Algorithm
thread_pool_stall_limit = 6
thread_pool_prio_kickup_timer = 1000
thread_pool_max_unused_threads = 0


啟動正常:
SSOT01:/usr/local/mysql/data>service mysqld restart
MySQL server PID file could not be found!                                                                                                        failed
Starting MySQL........                                                                                                                           done


之前是刪除了ibdata*或ib_logfile*,都無法啟動mysql服務
而且SSOT01.pid這個檔案就算手工建立也會自動被刪除。
必須把ibdata*和ib_logfile*都刪除才可以,再重新啟動mysql服務正常,並重新自動生成了SSOT01.pid檔案。
但是因為資料庫是innodb_file_per_table    | OFF 共享表空間模式,所以刪除ibdata*後,資料檔案還需要自己手工還原。


來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/22996654/viewspace-2286956/,如需轉載,請註明出處,否則將追究法律責任。

相關文章