Can't connect to '/var/run/mysqld/mysqld.sock'
<p>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 ;)).</p>

<p>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:</p>

<pre><code>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
</code></pre>

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

<p>Following these posts <a href="https://stackoverflow.com/questions/11657829/error-2002-hy000-cant-connect-to-local-mysql-server-through-socket-var-run">1</a> and
<a href="https://stackoverflow.com/questions/5376427/cant-connect-to-local-mysql-server-through-socket-var-mysql-mysql-sock-38">2</a>, I tried</p>

<pre><code>sudo find / -type s
</code></pre>

<p>resulting in this output:</p>

<pre><code>/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
</code></pre>

<p>In the processes with <code>top</code> 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.</p>

<p>I also had a look at</p>

<pre><code>/etc/mysql/my.cnf
/etc/mysql/debian.cnf
</code></pre>

<p>both show /var/run/mysqld/mysqld.sock as socket...</p>

<pre><code>/var/lib/mysql/my.cnf
</code></pre>

<p>mentioned <a href="https://stackoverflow.com/questions/11657829/error-2002-hy000-cant-connect-to-local-mysql-server-through-socket-var-run">here</a> does not exist.</p>

<p>Additionally, it seems that I can't connect to mysql through</p>

<pre><code>mysql -u user -p
</code></pre>

<p>at least it results in the Error 2002 as well.</p>

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

<pre><code>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)
</code></pre>

<p>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!!!</p>

<p>Thank you very much!!!</p>