【发布时间】:2017-11-20 11:04:47
【问题描述】:
我目前在我的树莓派上使用 wordpress。就在最近,我尝试连接到 apache Web 服务器并遇到了一个有趣的错误。 Error establishing a database connection. 所以我四处寻找和摆弄我的树莓派,发现 mysql 服务不再运行。我做了一个systemctl status mysql.service -l,得到了这个疯狂的长输出,对我来说是一种外星语言:
Jun 17 22:06:58 Latridell_Server /etc/init.d/mysql[5630]: 0 processes alive and '/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf ping' resulted in
Jun 17 22:06:58 Latridell_Server /etc/init.d/mysql[5630]: [61B blob data]
Jun 17 22:06:58 Latridell_Server /etc/init.d/mysql[5630]: error: 'Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)'
Jun 17 22:06:58 Latridell_Server /etc/init.d/mysql[5630]: Check that mysqld is running and that the socket: '/var/run/mysqld/mysqld.sock' exists!
Jun 17 22:06:58 Latridell_Server /etc/init.d/mysql[5630]:
Jun 17 22:06:58 Latridell_Server mysql[4891]: Starting MySQL database server: mysqld . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . failed!
Jun 17 22:06:58 Latridell_Server systemd[1]: mysql.service: control process exited, code=exited status=1
Jun 17 22:06:58 Latridell_Server systemd[1]: Failed to start LSB: Start and stop the mysql database server daemon.
Jun 17 22:06:58 Latridell_Server systemd[1]: Unit mysql.service entered failed state.
有人可以做点什么吗?
提前感谢您的帮助!
-一个在 mysql 和 linux 的世界里游荡的菜鸟
【问题讨论】:
-
嗯,这可能意味着什么。您将不得不搜索 MySQL 自己的日志文件以找出问题所在。我会开始查看
/var/log(它可能有自己的文件或者是syslog或messages或其他地方的一部分)。如果不能,则日志记录可能已禁用或未正确配置。找出 MySQL 没有启动的原因可能会很痛苦。