var run mysql mysqld,无法连接到'/var/run/mysqld/mysqld.sock'

This is my first post here, so I hope I do everything right and don't forget any important info. I'm glad for any hints, because I'm running out of ideas (if I ever had any ;)).

I am (or was) running owncloud on Raspbian Jessie (so I guess basically Debian). Suddenly owncloud stopped working. The nginx error points towards php5-fpm, further searches gave this error:

exception 'Doctrine\DBAL\DBALException' with message 'Failed to connect to the database: An exception occured in driver: SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)' in /var/www/owncloud/lib/private/db/connection.php:54

So it looks like a mysql error, and /var/run/mysqld/ is actually empty.

Following these posts 1 and

2, I tried

sudo find / -type s

resulting in this output:

/run/php5-fpm.sock

/run/fail2ban/fail2ban.sock

/run/thd.socket

/run/dhcpcd.unpriv.sock

/run/dhcpcd.sock

/run/dbus/system_bus_socket

/run/avahi-daemon/socket

/run/udev/control

/run/systemd/journal/syslog

/run/systemd/journal/socket

/run/systemd/journal/stdout

/run/systemd/journal/dev-log

/run/systemd/shutdownd

/run/systemd/private

/run/systemd/notify

find: `/proc/30933/task/30933/fd/5': No such file or directory

find: `/proc/30933/task/30933/fdinfo/5': No such file or directory

find: `/proc/30933/fd/5': No such file or directory

find: `/proc/30933/fdinfo/5': No such file or directory

In the processes with top on the other hand, mysqld and mysqld_safe show up.

mysql-client, mysql-server and php5-mysql are installed and updated to the latest versions.

I also had a look at

/etc/mysql/my.cnf

/etc/mysql/debian.cnf

both show /var/run/mysqld/mysqld.sock as socket...

/var/lib/mysql/my.cnf

mentioned here does not exist.

Additionally, it seems that I can't connect to mysql through

mysql -u user -p

at least it results in the Error 2002 as well.

Finally, I tried stopping and starting the mysql service. This resulted in the following output of

systemctl status mysql.service

mysql.service - LSB: Start and stop the mysql database server daemon

Loaded: loaded (/etc/init.d/mysql)

Active: failed (Result: exit-code) since So 2016-04-10 11:54:23 CEST; 23s ago

Process: 9777 ExecStop=/etc/init.d/mysql stop (code=exited, status=0/SUCCESS)

Process: 12878 ExecStart=/etc/init.d/mysql start (code=exited, status=1/FAILURE)

So I'm kind of lost what is going on, the problem occurs since some updates a few days ago. While writing this post, I went through all the steps again, just to be safe. At one point, I had a short glimpse at my owncloud instance in the browser, but then it was gone again. So I appreciate any help/hints!!!

Thank you very much!!!

解决方案

I faced the issue: Can't connect to '/var/run/mysqld/mysqld.sock'. The problem was that mysql service was not started after installation. Once I run the following command, then it worked properly:

systemctl start mysql.service

mysql -u root -p

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值