SQLSTATE[HY000] [2002] No such file or directory: This error keeps poping up. I have installed magento 2.3.5 version Please let me know how to fix this error
Thanks
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hi @baljinderekrocx,
You’ll most probably have to change the hostname from localhost to 127.0.0.1 in the env configuration file of your Magento application.
First, go to your Website’s DocumentRoot
cd /path/to/website
Once inside open the config file
nano app/etc/env.php
In there you’ll find an enviroment called host, change it like so
change 'host' => 'localhost' to 'host' =>'127.0.0.1'
Save the file and reload the website to see if the error is still being experienced.
Regards, KFSys
Hello,
Once, can you check if the MySQL service is up and running. If it is down, you will need to restart.
service mysql start
You also may have to change the hostname from localhost to 127.0.0.1 in env configuration file in your magento root directory
Open app/etc/env.php
change 'host' => 'localhost' to 'host' =>'127.0.0.1'
Save file and retry
Keep us posted, if this worked.
Cheers, Sri Charan
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.