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 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.