【发布时间】:2014-09-22 06:35:19
【问题描述】:
大家好,我正在亚马逊 ec2 linus 免费套餐实例中运行我的 magento 站点。
我在几分钟前随机停止工作后启动 MySQL 时遇到问题。我在尝试连接时收到此错误:
SQLSTATE[HY000] [2003] 无法连接到 '127.0.0.1' (111) 上的 MySQL 服务器
所以我尝试重新启动 MySQL(这对我以前有用),我得到了这个:
停止mysqld:[确定] MySQL 守护程序无法启动。 启动 mysqld:[失败]
这是我的mysql错误日志
140707 15:04:09 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
140707 15:04:10 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
140707 15:04:10 [Note] Plugin 'FEDERATED' is disabled.
140707 15:04:10 InnoDB: The InnoDB memory heap is disabled
140707 15:04:10 InnoDB: Mutexes and rw_locks use GCC atomic builtins
140707 15:04:10 InnoDB: Compressed tables use zlib 1.2.7
140707 15:04:10 InnoDB: Using Linux native AIO
140707 15:04:10 InnoDB: Initializing buffer pool, size = 128.0M
140707 15:04:10 InnoDB: Completed initialization of buffer pool
140707 15:04:10 InnoDB: highest supported file format is Barracuda.
140707 15:04:10 InnoDB: Waiting for the background threads to start
140707 15:04:11 InnoDB: 5.5.38 started; log sequence number 14130260
140707 15:04:11 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306
140707 15:04:11 [Note] - '0.0.0.0' resolves to '0.0.0.0';
140707 15:04:11 [Note] Server socket created on IP: '0.0.0.0'.
140707 15:04:11 [Note] Event Scheduler: Loaded 0 events
140707 15:04:11 [Note] /usr/libexec/mysqld: ready for connections.
Version: '5.5.38' socket: '/var/lib/mysql/mysql.sock' port: 3306 MySQL Community Server (GPL)
140707 18:32:03 mysqld_safe Number of processes running now: 0
140707 18:32:03 mysqld_safe mysqld restarted
140707 18:32:04 [Note] Plugin 'FEDERATED' is disabled.
140707 18:32:05 InnoDB: The InnoDB memory heap is disabled
140707 18:32:05 InnoDB: Mutexes and rw_locks use GCC atomic builtins
140707 18:32:05 InnoDB: Compressed tables use zlib 1.2.7
140707 18:32:05 InnoDB: Using Linux native AIO
140707 18:32:05 InnoDB: Initializing buffer pool, size = 128.0M
InnoDB: mmap(137363456 bytes) failed; errno 12
140707 18:32:05 InnoDB: Completed initialization of buffer pool
140707 18:32:05 InnoDB: Fatal error: cannot allocate memory for the buffer pool
140707 18:32:05 [ERROR] Plugin 'InnoDB' init function returned error.
140707 18:32:05 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
140707 18:32:05 [ERROR] Unknown/unsupported storage engine: InnoDB
140707 18:32:05 [ERROR] Aborting
这是我的 etc/my.cnf 文件
[mysqld] 数据目录=/var/lib/mysql socket=/var/lib/mysql/mysql.sock
#禁用符号链接以防止各种安全风险 符号链接=0
#Settings 使用 systemd 时忽略用户和组。
#如果需要在不同的用户或组下运行mysqld,
#根据 mysqld 自定义你的 systemd 单元文件
#instructions in http://fedoraproject.org/wiki/Systemd
[mysqld_safe] 日志错误=/var/log/mysqld.log pid-file=/var/run/mysqld/mysqld.pid
在 var/lib/mysql 中我找不到用于日志的 mysql.sock 文件。但我的默认套接字指向 var/lib/mysql/mysql.sock
我的mysql版本(5.5)
如果我输入命令
mysql --version 它显示
mysql Ver 14.14 Distrib 5.5.38,适用于 Linux (x86_64),使用 readline 5.1
请建议我该怎么做。我不时收到此错误,我的网站在几个小时内运行良好,一段时间后我收到此错误,所以请建议我如何永久解决此问题。
如果您需要任何其他详细信息,请列出我。
提前致谢。
【问题讨论】:
标签: magento-1.8 mysql amazon-web-services amazon