我在一个数字海洋实例上托管一个WordPress网站,这是一个非托管云实例。我以前有一个问题,当我去我的网站时,它说,数据库连接没有建立。那么为了使它工作,我需要重新启动mysql服务。MySQL停止致命错误
现在我再次得到相同的错误,这个时间频率也很高。所以我去了错误日志,我认为这个部分,我在这里粘贴指向问题:
141123 3:15:39 InnoDB: The InnoDB memory heap is disabled
141123 3:15:39 InnoDB: Mutexes and rw_locks use GCC atomic builtins
141123 3:15:39 InnoDB: Compressed tables use zlib 1.2.3.4
141123 3:15:39 InnoDB: Initializing buffer pool, size = 128.0M
InnoDB: mmap(135987200 bytes) failed; errno 12
141123 3:15:39 InnoDB: Completed initialization of buffer pool
141123 3:15:39 InnoDB: Fatal error: cannot allocate memory for the buffer pool
141123 3:15:39 [ERROR] Plugin 'InnoDB' init function returned error.
141123 3:15:39 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
141123 3:15:39 [ERROR] Unknown/unsupported storage engine: InnoDB
141123 3:15:39 [ERROR] Aborting
所以我觉得问题是,因为它无法分配用于缓冲池内存,因为这是致命的错误,然后这可能是什么,这阻止了MySQL。但问题是我不知道如何解决它,如果这是真的认为是造成问题?那么它是与服务器配置相关还是可以在我的代码中有一些野生查询?请让我知道你认为可以解决这个问题?
在此先感谢你们。
---- ------更新
试图@Sajidkhan的修复(以下答案之一)之后。 Sill mysql在一段时间后关闭,但是这次日志有点不同。以下是我现在可以看到的。
141206 14:38:59 [Note] Plugin 'FEDERATED' is disabled.
141206 14:38:59 InnoDB: The InnoDB memory heap is disabled
141206 14:38:59 InnoDB: Mutexes and rw_locks use GCC atomic builtins
141206 14:38:59 InnoDB: Compressed tables use zlib 1.2.3.4
141206 14:38:59 InnoDB: Initializing buffer pool, size = 128.0M
141206 14:38:59 InnoDB: Completed initialization of buffer pool
141206 14:38:59 InnoDB: highest supported file format is Barracuda.
InnoDB: The log sequence number in ibdata files does not match
InnoDB: the log sequence number in the ib_logfiles!
141206 14:38:59 InnoDB: Database was not shut down normally!
InnoDB: Starting crash recovery.
InnoDB: Reading tablespace information from the .ibd files...
InnoDB: Restoring possible half-written data pages from the doublewrite
InnoDB: buffer...
141206 14:38:59 InnoDB: Waiting for the background threads to start
141206 14:39:00 InnoDB: 5.5.31 started; log sequence number 512843890
但是如果我的数据库使用innodb作为存储引擎会如何影响更改默认存储引擎?我的意思是我们只会通过上面的命令更改默认存储引擎,所以当它需要使用innodb时,不会再发生同样的错误? – Hafiz 2014-11-25 12:33:26
我试过这个,但它没有工作仍然数据库问题仍然存在,MySQL停止 – Hafiz 2014-12-06 16:55:04