2014-02-15 38 views
2

我知道這個問題已經在這裏問了很多次了,我搜索了很多,發現了各種答案,但仍然無法解決我的問題。MySQL意外關機

Apache在80端口上運行成功,但是當我嘗試啓動mysql時,它給了我下面的錯誤信息。

13:36:13 [mysql] Error: MySQL shutdown unexpectedly. 
13:36:13 [mysql] This may be due to a blocked port, missing dependencies, 
13:36:13 [mysql] improper privileges, a crash, or a shutdown by another method. 
13:36:13 [mysql] Press the Logs button to view error logs and check 
13:36:13 [mysql] the Windows Event Viewer for more clues 
13:36:13 [mysql] If you need more help, copy and post this 
13:36:13 [mysql] entire log window on the forums 

日誌文件

140215 13:36:13 [Note] Plugin 'FEDERATED' is disabled. 
140215 13:36:13 InnoDB: The InnoDB memory heap is disabled 
140215 13:36:13 InnoDB: Mutexes and rw_locks use Windows interlocked functions 
140215 13:36:13 InnoDB: Compressed tables use zlib 1.2.3 
140215 13:36:13 InnoDB: Initializing buffer pool, size = 16.0M 
140215 13:36:13 InnoDB: Completed initialization of buffer pool 
InnoDB: Error: space header page consists of zero bytes in data file D:\xampp\mysql\data\ibdata1 
140215 13:36:13 InnoDB: Could not open or create data files. 
140215 13:36:13 InnoDB: If you tried to add new data files, and it failed here, 
140215 13:36:13 InnoDB: you should now edit innodb_data_file_path in my.cnf back 
140215 13:36:13 InnoDB: to what it was, and remove the new ibdata files InnoDB created 
140215 13:36:13 InnoDB: in this failed attempt. InnoDB only wrote those files full of 
140215 13:36:13 InnoDB: zeros, but did not yet use them in any way. But be careful: do not 
140215 13:36:13 InnoDB: remove old data files which contain your precious data! 
140215 13:36:13 [ERROR] Plugin 'InnoDB' init function returned error. 
140215 13:36:13 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed. 
140215 13:36:13 [ERROR] Unknown/unsupported storage engine: InnoDB 
140215 13:36:13 [ERROR] Aborting 

請指導我如何解決這個問題。

問候, 阿夫塔卜

+2

您可能損壞了您的數據庫文件(D:\ xampp \ mysql \ data \ ibdata1)?或者你指向一個錯誤的路徑 –

+0

我發現這在後''ibdata'文件刪除它將正常工作,這就是爲什麼我刪除它。 –

+0

當您刪除ibdata1時,是否還從MySQL目錄中刪除了ib_logfile0,ib_logfile1?如果不嘗試這樣做讓InnoDB再次加載並且MySQL出現。爲了預防,您可以保留這些文件的副本,而不是直接刪除 – shinesecret

回答

1

你可能想看看這裏: https://superuser.com/questions/653953/cant-start-mysql-xampp-after-installing-on-external-drive

希望你刪除之前沒有你的文件的副本?

+0

我已經用ibdata1刪除了logfile0,logfile1。現在它不給我任何錯誤消息,並顯示數據庫名稱在phpmyadmin,但是當我點擊任何表名稱,它說'abc表是空的'。請告訴我爲什麼它noyt顯示錶數據。 –

+0

那麼如果你刪除了ibdata文件(包含數據),這很合乎邏輯,你不會看到任何沒有? –

+0

ibdata又回來了,但數據不在cdcol數據庫以外的表中。 –

1

我有一個類似的錯誤,並設法用此方法解決它:

去XAMPP/MySQL的/斌/ my.ini的

添加以下行:

innodb_force_recovery = 1 

(我認爲任何大於0的東西都可以在這裏使用,也可以在文件的備份上安全地進行備份。)

您現在應該能夠成功啓動mySQL服務。

+0

問題解決了,但現在我得到空數據庫。當我點擊任何表名時,它說表是空的。 –

+0

這可能是因爲你與ibdata1文件混淆而發生的。如果你這樣做,你的桌子會迷路:c – Rebirth