'.\mysql-bin.000078' not found (Errcode: 2 - No such file or directory)

如果你的 mysql 有開啟 log-bin
那麼在 data 資料夾下就會有一堆的 mysql-bin.00001 等依序產生的檔案
這個檔案超過 1G 或是重開就會繼續產生下一個
(在 production mode 這些是很重要的)
但在測試的環境下還蠻占空間的
上次無意識的把他刪除了
今天要開啟 mysql 才發現無法啟動
會出現下面錯誤訊息:

2014-01-26 19:47:57 8844 [Note] Plugin 'FEDERATED' is disabled.
2014-01-26 19:47:57 8844 [Note] InnoDB: The InnoDB memory heap is disabled
2014-01-26 19:47:57 8844 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions
2014-01-26 19:47:57 8844 [Note] InnoDB: Compressed tables use zlib 1.2.3
2014-01-26 19:47:57 8844 [Note] InnoDB: Not using CPU crc32 instructions
2014-01-26 19:47:57 8844 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2014-01-26 19:47:57 8844 [Note] InnoDB: Completed initialization of buffer pool
2014-01-26 19:47:57 8844 [Note] InnoDB: Highest supported file format is Barracuda.
2014-01-26 19:47:57 8844 [Note] InnoDB: 128 rollback segment(s) are active.
2014-01-26 19:47:58 8844 [Note] InnoDB: Waiting for purge to start
2014-01-26 19:47:58 8844 [Note] InnoDB: 5.6.12 started; log sequence number 945153733
wampmysqld: File '.\mysql-bin.000078' not found (Errcode: 2 - No such file or directory)

2014-01-26 19:47:58 8844 [ERROR] Failed to open log (file '.\mysql-bin.000078', errno 2)
2014-01-26 19:47:58 8844 [ERROR] Could not open log file
2014-01-26 19:47:58 8844 [ERROR] Can't init tc log
2014-01-26 19:47:58 8844 [ERROR] Aborting
由於之前把 mysql-bin.* 都刪除了
mysql 再啟動時會繼續上一次的 sequence 繼續
找不到的時候就會無法開啟
這時候把 mysql-bin.index 也刪掉再重開
就會正常囉!

PS. 也可能不是 mysql-bin.* 的方式命名,這是可以自訂的,預設是 mysql-bin

Reference
killall mysql服务 mysql服务后无法启动


Comments

Popular posts from this blog

CentOS7 如何新增/移除 Rich Rule for firewalld

mac 安裝 mtr

Howto use Postman test Cors