我正在托管一个安装了 Magento 的本地 LAMP 服务器(在 中/var/www/html/magento
),我工作正常,但今晚我设法破坏了一些东西。
我在我的 Magento 设置中遇到了一个问题(老实说我不记得是什么),它促使我运行chmod -R -777 /var/
并chown -R travis /var/
授予对其中所有文件的权限。
这导致了 Apache 403 错误,我通过运行chmod -R -755 /var/www/
和chown -R root /var/
. 进一步的权限已修复chmod -R -777 /var/www/html/magento
。
快进到现在
我无法启动我的 MySQL 服务。这是我得到的:
travis@travis: service mysql stop
travis@travis: service mysql start
Job for mysql.service failed. See "systemctl status mysql.service" and "journalctl -xe" for details.
travis@travis:/etc/mysql$ systemctl status mysql.service -l
● mysql.service - MySQL Community Server
Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
Active: activating (start-post) (Result: exit-code) since Wed 2015-06-17 23:01:24 EDT; 7min ago
Process: 31638 ExecStart=/usr/bin/mysqld_safe (code=exited, status=2)
Process: 31635 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=0/SUCCESS)
Main PID: 31638 (code=exited, status=2); : 31639 (mysql-systemd-s)
CGroup: /system.slice/mysql.service
└─control
├─ 1072 sleep 1
└─31639 /bin/bash /usr/share/mysql/mysql-systemd-start post
Jun 17 23:01:24 travis systemd[1]: Starting MySQL Community Server...
Jun 17 23:01:24 travis mysqld_safe[31638]: 150617 23:01:24 mysqld_safe Can't log to error log and syslog at the same time. Remove all --log-error configuration options for --syslog to take effect.
Jun 17 23:01:24 travis mysqld_safe[31638]: 150617 23:01:24 mysqld_safe Logging to '/var/log/mysql/error.log'.
Jun 17 23:01:24 travis mysqld_safe[31638]: touch: cannot touch ‘/var/log/mysql/error.log’: Permission denied
Jun 17 23:01:24 travis mysqld_safe[31638]: chmod: cannot access ‘/var/log/mysql/error.log’: Permission denied
Jun 17 23:01:24 travis mysqld_safe[31638]: 150617 23:01:24 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
Jun 17 23:01:24 travis mysqld_safe[31638]: /usr/bin/mysqld_safe: 126: /usr/bin/mysqld_safe: cannot create /var/log/mysql/error.log: Permission denied
Jun 17 23:01:24 travis mysqld_safe[31638]: /usr/bin/mysqld_safe: 1: eval: cannot create /var/log/mysql/error.log: Permission denied
Jun 17 23:01:24 travis systemd[1]: mysql.service: main process exited, code=exited, status=2/INVALIDARGUMENT
现在,我的 Magento 站点127.0.0.1/magento/
显示一个错误页面,其中包含:
SQLSTATE[HY000] [2003] Can't connect to MySQL server on '127.0.0.1' (111)