MySQL意外关机

问题描述:

我知道这个问题已经在这里问了很多次了,我搜索了很多,发现了各种答案,但仍然无法解决我的问题。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

你可能想看看这里: 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数据库以外的表中。 –

我有一个类似的错误,并设法用此方法解决它:

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

添加以下行:

innodb_force_recovery = 1 

(我认为任何大于0的东西都可以在这里使用,也可以在文件的备份上安全地进行备份。)

您现在应该能够成功启动mySQL服务。

+0

问题解决了,但现在我得到空数据库。当我点击任何表名时,它说表是空的。 –

+0

这可能是因为你与ibdata1文件混淆而发生的。如果你这样做,你的桌子会迷路:c – Rebirth