0

Magento 显示“处理您的请求时出错”

尝试命令“sudo service mysqld restart”但无法启动时

然后查看显示“SQLSTATE[HY000] [2002] No such file or directory”的日志

我在 Google、stackoverflow、magento stackoverflow 网站上进行了少量搜索,最后得到了一些可能是

在命令“mysqld -u root -p status”之后

显示 'mysqladmin: connect to server at 'localhost' failed error: 'Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)' 检查 mysqld 是否正在运行并且套接字: '/var/lib/mysql/mysql.sock' 存在!

我发现我在 /var/lib/mysql/ 中没有 mysql.sock 所以现在我应该做什么。我不是专家,只是新手。不幸的是,我为 ec2 实例中的所有目录授予了 777 权限,经过一段时间后,我看到我的网站“处理您的请求时出错。出于 ec2 安全原因,我无法使用 ftp 或 ssh 访问实例。所以我必须创建新实例将此 EBS 提供给新实例,更改权限后我能够访问我的实例

请看一下我的 my.cnf 文件。我看到有些东西可以提供帮助

[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
# Settings user and group are ignored when systemd is used.
# If you need to run mysqld under a different user or group,
# customize your systemd unit file for mysqld according to the
# instructions in http://fedoraproject.org/wiki/Systemd

[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid

这是mysqld.log

/usr/libexec/mysql55/mysqld: Can't create/write to file '/tmp/ibmCz4dv'     (Errcode: 13)
160212 18:29:37  InnoDB: Error: unable to create temporary file; errno: 13
160212 18:29:37 [ERROR] Plugin 'InnoDB' init function returned error.
160212 18:29:37 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE   failed.
160212 18:29:37 [ERROR] Unknown/unsupported storage engine: InnoDB
160212 18:29:37 [ERROR] Aborting
160212 18:29:37 [Note] /usr/libexec/mysql55/mysqld: Shutdown complete
160212 18:29:37 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended

775 到 /tmp 和现在 mysqld.log

775 到 /tmp 和 mysqld.log

/usr/libexec/mysql55/mysqld: Can't create/write to file '/tmp/ibLzshr1' (Errcode: 13)
160213  9:08:59  InnoDB: Error: unable to create temporary file; errno: 13
160213  9:08:59 [ERROR] Plugin 'InnoDB' init function returned error.
160213  9:08:59 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
160213  9:08:59 [ERROR] Unknown/unsupported storage engine: InnoDB
160213  9:08:59 [ERROR] Aborting

160213  9:08:59 [Note] /usr/libexec/mysql55/mysqld: Shutdown complete

160213 09:08:59 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended

请帮我整理一下

4

2 回答 2

0

我想说谢谢@Axel Amthor。最后我给了 /tmp 文件 777 并重新启动了 mysqld .. 和 Boom

网站重新投入使用。抱歉,我不能投票,因为我没有声誉 15 :(

于 2016-02-13T14:23:35.297 回答
0

mysql用户显然无权根据/ tmp创建文件

/usr/libexec/mysql55/mysqld: Can't create/write to file '/tmp/ibmCz4dv'     (Errcode: 13)

检查 /tmp 的访问权限,应该是777. BTW sys "errno 13" 是 "Permission denied"

据此,服务器停止并且不创建任何套接字,然后导致连接错误。

于 2016-02-13T08:01:33.440 回答