What should I do when I get the error message: SQLSTATE[HY000] [2002] Can’t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock’ (11)
This means that Matomo (Piwik) could not connect to your MySQL database. If you are on a dedicated server, you can try to restart the Mysql server by running, for example,
/etc/init.d/mysql restart
. If you are on a shared web hosting, we recommend contacting your web host and ask them to investigate why it fails to connect to the Mysql server.