我有一个拥有WordPress网站的亚马逊ec2微型实例。从昨天开始,我的mysql数据库一直在崩溃:
[ec2-user@ip-xxx-xx-xx-xxx ~]$ sudo service mysqld status
mysqld dead but subsys locked
我尝试重新启动mysqld,但是每隔5分钟就会出现同样的错误 - #34;错误建立数据库连接"
这是我的数据库日志文件读取的内容 -
160123 05:44:41 mysqld_safe mysqld restarted
160123 5:44:43 [Note] /usr/libexec/mysql55/mysqld (mysqld 5.5.46) starting as process 7928 ...
160123 5:44:44 [Note] Plugin 'FEDERATED' is disabled.
160123 5:44:46 InnoDB: The InnoDB memory heap is disabled
160123 5:44:46 InnoDB: Mutexes and rw_locks use GCC atomic builtins
160123 5:44:46 InnoDB: Compressed tables use zlib 1.2.8
160123 5:44:46 InnoDB: Using Linux native AIO
160123 5:44:46 InnoDB: Initializing buffer pool, size = 128.0M
InnoDB: mmap(137363456 bytes) failed; errno 12
160123 5:44:46 InnoDB: Completed initialization of buffer pool
160123 5:44:46 InnoDB: Fatal error: cannot allocate memory for the buffer pool
160123 5:44:46 [ERROR] Plugin 'InnoDB' init function returned error.
160123 5:44:46 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
160123 5:44:46 [ERROR] Unknown/unsupported storage engine: InnoDB
160123 5:44:46 [ERROR] Aborting
160123 5:44:46 [Note] /usr/libexec/mysql55/mysqld: Shutdown complete
160123 05:44:46 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
当我用Google搜索问题的解决方案时发现的常见解决方案 - mysqld dead but subsys locked
,就是创建一个交换文件。我完全按照大多数解决方案的建议,但由于我不熟悉UNIX,我不知道我所做的是对还是不对。
或者,这个问题是否还有其他解决方案。请帮助。
答案 0 :(得分:2)
您是否尝试过此mysql is dead but subsys locked
似乎很简单。另外请考虑转移到RDS而不是在ec2中运行mysql服务器。让您免于此类麻烦。