2014-03-05 57 views
0

所以它發生在我身上幾次,我有這個問題。我沒有意識到爲什麼發生這種情況,我剛剛知道重新啓動電腦後,MySQL不會啓動。XAMPP mysql innodb恢復失敗後,電腦崩潰

,所以我重新安裝XAMPP和周圍幾次,直到搞亂我得到它的工作。上次發生時,我看着mysql.err文件,發現錯誤是關於損壞的文件。所以我刪除這些數據庫和MySQL開始

但今天,我已經看到了正當的理由。當它突然被凍結並重新啓動時,我坐在電腦前。之後,MySQL將無法啓動。

看着我的本地/ XAMPP狀態頁面,它說的mysql停用

去檢查日誌,實際上mysql.err文件有它說,墜機和InnoDB恢復不能從崩潰中恢復。

這裏是日誌

2014-03-05 11:18:11 7829 mysqld_safe Starting mysqld daemon with databases from /opt/lampp/var/mysql 
2014-03-05 11:18:11 0 [Warning] Using unique option prefix key_buffer instead of key_buffer_size is deprecated and will be removed in a future release. Please use the full name instead. 
2014-03-05 11:18:11 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details). 
2014-03-05 11:18:11 8235 [Note] Plugin 'FEDERATED' is disabled. 
2014-03-05 11:18:11 8235 [Note] InnoDB: The InnoDB memory heap is disabled 
2014-03-05 11:18:11 8235 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins 
2014-03-05 11:18:11 8235 [Note] InnoDB: Compressed tables use zlib 1.2.8 
2014-03-05 11:18:11 8235 [Note] InnoDB: Not using CPU crc32 instructions 
2014-03-05 11:18:11 8235 [Note] InnoDB: Initializing buffer pool, size = 16.0M 
2014-03-05 11:18:11 8235 [Note] InnoDB: Completed initialization of buffer pool 
2014-03-05 11:18:11 8235 [Note] InnoDB: Highest supported file format is Barracuda. 
2014-03-05 11:18:11 8235 [Note] InnoDB: The log sequence numbers 11011943 and 11011943 in ibdata files do not match the log sequence number 11012198 in the ib_logfiles! 
2014-03-05 11:18:11 8235 [Note] InnoDB: Database was not shutdown normally! 
2014-03-05 11:18:11 8235 [Note] InnoDB: Starting crash recovery. 
2014-03-05 11:18:11 8235 [Note] InnoDB: Reading tablespace information from the .ibd files... 
2014-03-05 11:18:11 8235 [ERROR] InnoDB: Attempted to open a previously opened tablespace. Previous tablespace wpdemo/wp_terms uses space ID: 93 at filepath: ./wpdemo/wp_terms.ibd. Cannot open tablespace wordpress/wp_evg_feeds which uses space ID: 93 at filepath: ./wordpress/wp_evg_feeds.ibd 
2014-03-05 11:18:11 7f3ca4a11700 InnoDB: Operating system error number 2 in a file operation. 
InnoDB: The error means the system cannot find the path specified. 
InnoDB: If you are installing InnoDB, remember that you must create 
InnoDB: directories yourself, InnoDB does not create them. 
InnoDB: Error: could not open single-table tablespace file ./wordpress/wp_evg_feeds.ibd 
InnoDB: We do not continue the crash recovery, because the table may become 
InnoDB: corrupt if we cannot apply the log records in the InnoDB log to it. 
InnoDB: To fix the problem and start mysqld: 
InnoDB: 1) If there is a permission problem in the file and mysqld cannot 
InnoDB: open the file, you should modify the permissions. 
InnoDB: 2) If the table is not needed, or you can restore it from a backup, 
InnoDB: then you can remove the .ibd file, and InnoDB will do a normal 
InnoDB: crash recovery and ignore that table. 
InnoDB: 3) If the file system or the disk is broken, and you cannot remove 
InnoDB: the .ibd file, you can set innodb_force_recovery > 0 in my.cnf 
InnoDB: and force InnoDB to continue crash recovery here. 
2014-03-05 11:18:11 7829 mysqld_safe mysqld from pid file /opt/lampp/var/mysql/aleksandar-PC.pid ended 

最後一次,當我得到一個錯誤,我沒有意識到這是因爲電腦死機的,我沒有必要的文件,所以我只是刪除損壞的數據庫文件和MySQL開始。問題是現在我不能刪除任何文件,我需要這些數據庫回來和工作。 有什麼建議嗎?

回答

0

那麼重命名碎文件例如wp_terms.ibd.bkp因此MySQL可以跳過這些表,並開始。現在當mysql恢復並開始時,我會定期關閉它。將.bkp文件重命名爲普通表文件並啓動mysql。現在當mysql定期關閉時,它不會檢查恢復並正常啓動。應該被破壞的文件正在工作。一切都恢復正常。什麼邏輯!