2017-08-12 75 views
0

當試圖啓動mysql服務器時,它返回退出代碼1.我已經完成了這一百萬這個服務器之前的時間。 在上個月沒有搞亂服務器,mysql突然停止,我無法啓動它。我的error.log:MySQL已損壞,無法啓動:「從雙寫緩衝區中恢復可能的半寫數據頁...」

[Note] InnoDB: Using mutexes to ref count buffer pool pages 
[Note] InnoDB: The InnoDB memory heap is disabled 
[Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins 
[Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier 
[Note] InnoDB: Compressed tables use zlib 1.2.8 
[Note] InnoDB: Using Linux native AIO 
[Note] InnoDB: Using SSE crc32 instructions 
[Note] InnoDB: Initializing buffer pool, size = 128.0M 
[Note] InnoDB: Completed initialization of buffer pool 
[Note] InnoDB: Highest supported file format is Barracuda. 
[Note] InnoDB: Starting crash recovery from checkpoint LSN=591771482442 

Everything goes to ruin below this line. 

[Note] InnoDB: Restoring possible half-written data pages from the doublewrite buffer... 
InnoDB: Set innodb_force_recovery to ignore this error. 
[ERROR] Plugin 'InnoDB' init function returned error. 
[ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed. 
[Note] Plugin 'FEEDBACK' is disabled. 
[ERROR] Unknown/unsupported storage engine: InnoDB 
[ERROR] Aborting 

,直到我能啓動mysql服務器,我不能運行mysqldump也不mysql -u root

Got error: 2002: "Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2 "No such file or directory")" when trying to connect 

我正在MariaDB的服務器10.1.23-9-deb9u1。

+0

錯誤日誌中是否有任何內容替代「一切都會在這條線下面毀滅?」?懷疑沒有任何失敗的雙寫緩衝區恢復會導致InnoDB失敗 –

回答

1

不知道這是否會工作,但由於服務器不反正工作,所以嘗試了這一點:

重命名logfile0logfile1,然後重新啓動服務器。

在做任何事之前,將整個mysql文件夾複製到另一個位置以防萬一。

0

答案是我的右盈:

InnoDB: Set innodb_force_recovery to ignore this error. 

我設置innodb_force_recovery = 1/etc/mysql/mariadb.conf.d/50-server.cnf的[mysqld]子句後(該文件很可能視操作系統而定)。

我重新啓動它並自行修復。我後來拿出innodb_force_recovery = 1並重新啓動,然後它工作得很好。

我學到了什麼?對「自動修復」程序有更多的信心。由於我接觸到Microsoft Windows,我的期望對他們來說太低了。

+0

innodb_force_recovery = 1忽略損壞的頁面。你怎麼知道它已經「修復了」?你能訪問你的數據嗎? –

+0

@LaurynasBiveinis是的。一切都恢復正常。不知道,也許在寫短暫停電的中間? –

+0

下面是問題:* [注意] InnoDB:從雙寫緩衝區中恢復可能的半寫數據頁... * **不是錯誤**。因此,InnoDB:InnoDB_force_recovery忽略這個錯誤是沒有意義的。另外,'innodb_force_recovery'不是一個明確的選項。它基本上使得恢復過程**不那麼謹慎,不太徹底。** [*「在緊急情況下只將innodb_force_recovery設置爲大於0的值,以便啓動InnoDB並轉儲您的表。」*]( https://dev.mysql.com/doc/refman/5.7/en/forcing-innodb-recovery.html) –

相關問題