Showing results for 
Search instead for 
Did you mean: 

SQLSTATE[HY000] [2002]

SQLSTATE[HY000] [2002]

Hi I'm a new user in Magento management. For some days these errors have appeared to me and I don't know where to start to understand what the problem may be and how to solve it. If any of you have more experience on this, I ask for help


Thank you


Version Magento, php version: 7.0.30



SQLSTATE[HY000] [2002] No such file or directory
Trace: #0 /home/nglcchf/domains/ Zend_Db_Adapter_Pdo_Abstract->_connect() #1 /home/nglcchf/domains/ Zend_Db_Adapter_Pdo_Mysql->_connect() #2 /home/nglcchf/domains/ Varien_Db_Adapter_Pdo_Mysql->_connect() #3 /home/nglcchf/domains/ Zend_Db_Adapter_Abstract->query('SET NAMES utf8', Array) #4 /home/nglcchf/domains/ Zend_Db_Adapter_Pdo_Abstract->query('SET NAMES utf8', Array) #5 /home/nglcchf/domains/ Varien_Db_Adapter_Pdo_Mysql->query('SET NAMES utf8') #6 /home/nglcchf/domains/ Mage_Core_Model_Resource->_newConnection('pdo_mysql', Object(Mage_Core_Model_Config_Element)) #7 /home/nglcchf/domains/ Mage_Core_Model_Resource->getConnection('core_setup') #8 /home/nglcchf/domains/ Mage_Core_Model_Resource_Setup->__construct('core_setup') #9 /home/nglcchf/domains/ Mage_Core_Model_Resource_Setup::applyAllUpdates() #10 /home/nglcchf/domains/ Mage_Core_Model_App->_initModules() #11 /home/nglcchf/domains/ Mage_Core_Model_App->run(Array) #12 /home/nglcchf/domains/ Mage::run('', 'store') #13 {main}

Re: SQLSTATE[HY000] [2002]

It seems you try to connect to MySQL via a socket and that fails. Is MySQL running right and is your configuration right.
The error is coming from the file you did mention, so that isn't the problem, Magento does see that file.
Try using an IP to connect to MySQL. Or check if your MySQL-socket is right.

If issue solved, Click Kudos & Accept as Solution.
LitCommerce - The Most Simple & Affordable Multi-channel Selling Tool