Fixed error: SQLSTATE[HY000] [2002]

I’ve been running Piwik/Matomo on self host for years now.
Today, I’ve noticed I could not connect to Matomo server as I get the error message:

Cannot connect to the database:

SQLSTATE[HY000] [2002] No such file or directory

I could not remember changing any thing on the server side, then I remembered I changed PHP Version. I switched back to PHP 5.6: I could log into Matomo. Then I switched to PHP 7.3, and I still could log into Matomo.
I don’t know what went wrong but I just thought I could share in case some one get stuck as well.


1 Like