![如何修復阻止 MySQL 資料從失效 HD 遷移的錯誤?](https://rvso.com/image/1518696/%E5%A6%82%E4%BD%95%E4%BF%AE%E5%BE%A9%E9%98%BB%E6%AD%A2%20MySQL%20%E8%B3%87%E6%96%99%E5%BE%9E%E5%A4%B1%E6%95%88%20HD%20%E9%81%B7%E7%A7%BB%E7%9A%84%E9%8C%AF%E8%AA%A4%EF%BC%9F.png)
我正在嘗試從損壞的 HD 中還原 MySQL 資料庫。我已按照此處有關複製舊文件的說明進行操作:https://stackoverflow.com/questions/40479395/export-mysql-datatabase-from-a-dead-hard-drive-xampp但我在錯誤日誌中收到以下訊息:
170114 22:21:07 [Note] Plugin 'FEDERATED' is disabled.
170114 22:21:07 InnoDB: The InnoDB memory heap is disabled
170114 22:21:07 InnoDB: Mutexes and rw_locks use Windows interlocked functions
170114 22:21:07 InnoDB: Compressed tables use zlib 1.2.3
170114 22:21:07 InnoDB: Initializing buffer pool, size = 38.0M
170114 22:21:07 InnoDB: Completed initialization of buffer pool
InnoDB: Error: log file .\ib_logfile0 is of different size 0 56623104 bytes
InnoDB: than specified in the .cnf file 0 19922944 bytes!
170114 22:21:07 [ERROR] Plugin 'InnoDB' init function returned error.
170114 22:21:07 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
170114 22:21:07 [ERROR] Unknown/unsupported storage engine: INNODB
170114 22:21:07 [ERROR] Aborting
170114 22:21:07 [Note] C:\Program Files\MySQL\MySQL Server 5.5\bin\mysqld.exe: Shutdown complete
舊資料庫是 5.5.40,新資料庫是 5.5.54,因為我無法成功安裝完全相同的版本(安裝程式所需的下載連結不再起作用)。錯誤只是.cnf
文件中指定的大小還是掩蓋了其他內容?
答案1
感謝@ITSolutions,我已經解決了這個問題。
我cnf
在以下位置找到了我的文件C:\Program Files\MySQL\MySQL Server 5.5\my.ini
(位置有時可能不同)。
我進行了以下更改(注意註解掉的原始值)並重新啟動 MySQL 服務。
# InnoDB, unlike MyISAM, uses a buffer pool to cache both indexes and
# row data. The bigger you set this the less disk I/O is needed to
# access data in tables. On a dedicated database server you may set this
# parameter up to 80% of the machine physical memory size. Do not set it
# too large, though, because competition of the physical memory may
# cause paging in the operating system. Note that on 32bit systems you
# might be limited to 2-3.5G of user level memory per process, so do not
# set it too high.
#innodb_buffer_pool_size=38M
innodb_buffer_pool_size=108M
# Size of each log file in a log group. You should set the combined size
# of log files to about 25%-100% of your buffer pool size to avoid
# unneeded buffer pool flush activity on log file overwrite. However,
# note that a larger logfile size will increase the time needed for the
# recovery process.
#innodb_log_file_size=19M
innodb_log_file_size=54M
它在幾秒鐘內加載完畢,我的所有數據都可以再次訪問!