我目前正在使用我的覆盆子pi上的wordpress。就在最近,我尝试连接到apache Web服务器并得到一个有趣的错误。 Error establishing a database connection.
所以我做了一些搜索和摆弄我的覆盆子pi,发现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世界中的一个flailing noob
答案 0 :(得分:0)
请做到这一点。
sudo service mysql stop
/usr/bin/mysql_install_db --user=mysql
然后
sudo service mysql start