for no reason in getting this error on
There has been an error processing your request SQLSTATE[HY000] [2002] No such file or directory
for no reason in getting this error on
There has been an error processing your request SQLSTATE[HY000] [2002] No such file or directory
You need try to change the database hostname
from localhost
to 127.0.0.1
into the following file.
app\etc\local.xml
This is showing that your MySQL client can't connect to the MySQL server.
I'm going to assume you're using localhost
as the host in your app/etc/local.xml
config so it'll be attempting to look for the MySQL socket at (usually) /var/run/mysqld/mysqld.sock
on the server. If it can't find it, then it throws this error. Check that MySQL is running and that this file (or another similar) exists.
If it is running but it just isn't connecting still, then try changing localhost
to 127.0.0.1
to have the client attempt to connect via TCP instead of a via the .sock
file.
If you're running on an environment where the MySQL server isn't located either via the .sock
file or at IP address 127.0.0.1
, then use the correct IP address/Hostname instead. For example, some hosts may put the DB on a hostname like db1.myhost.com
so your host entry in your config would look as <host>db1.myhost.com</host>
localhost
I mean the value in your app/etc/local.xml
file, and by your system I mean the server that the site is on.
Commented
Feb 5, 2020 at 15:09