Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Can’t connect to local MySQL server through socket ‘’ (111)
 
SmartPage
Jr. Member
 
Total Posts:  9
Joined:  2007-10-10
 

Hello!

I am trying to install magento on my server, but I have some troubles and I hope someone can help me out?!
The problem occur when I try to install the Magento software, and here is the error message:

exception ‘Zend_Db_Adapter_Exception’ with message ‘SQLSTATE[HY000] [2002] Can’t connect to local MySQL server through socket ‘’ (111)’ in /home/.sites/143/site2/web/lib/Zend/Db/Adapter/Pdo/Abstract.php:131
Stack trace:
#0 /home/.sites/143/site2/web/lib/Varien/Db/Adapter/Pdo/Mysql.php(76): Zend_Db_Adapter_Pdo_Abstract->_connect()
#1 /home/.sites/143/site2/web/lib/Zend/Db/Adapter/Abstract.php(367): Varien_Db_Adapter_Pdo_Mysql->_connect()
#2 /home/.sites/143/site2/web/lib/Zend/Db/Adapter/Pdo/Abstract.php(206): Zend_Db_Adapter_Abstract->query(’SET NAMES utf8’, Array)
#3 /home/.sites/143/site2/web/app/code/core/Mage/Core/Model/Resource/Type/Db/Pdo/Mysql.php(32): Zend_Db_Adapter_Pdo_Abstract->query(’SET NAMES utf8’)
#4 /home/.sites/143/site2/web/app/code/core/Mage/Core/Model/Resource.php(71): Mage_Core_Model_Resource_Type_Db_Pdo_Mysql->getConnection(Object(Mage_Core_Model_Config_Element))
#5 /home/.sites/143/site2/web/app/code/core/Mage/Core/Model/Mysql4/Abstract.php(240): Mage_Core_Model_Resource->getConnection(’core_read’)
#6 /home/.sites/143/site2/web/app/code/core/Mage/Core/Model/Mysql4/Config.php(47): Mage_Core_Model_Mysql4_Abstract->getConnection(’read’)
#7 /home/.sites/143/site2/web/app/code/core/Mage/Core/Model/Config.php(122): Mage_Core_Model_Mysql4_Config->getChecksum(’config_data,web...’)
#8 /home/.sites/143/site2/web/app/Mage.php(326): Mage_Core_Model_Config->init(NULL)
#9 /home/.sites/143/site2/web/app/Mage.php(349): Mage::init(NULL)
#10 /home/.sites/143/site2/web/index.php(27): Mage::run(’base’)
#11 {main}

Why is the socket empty? And where can I set the socket on my server?

 
Magento Community Magento Community
Magento Community
Magento Community
 
SmartPage
Jr. Member
 
Total Posts:  9
Joined:  2007-10-10
 

I have finally found the answer for the problem!

The problem is due to a bug in the Zend Framework, and the bug is assigned: Zend Framework issue

 
Magento Community Magento Community
Magento Community
Magento Community
 
Moshe
Magento Team
 
Avatar
Total Posts:  1770
Joined:  2007-08-07
Los Angeles
 

Did you try solution outlined here:
http://www.magentocommerce.com/boards/viewthread/136/

 
Magento Community Magento Community
Magento Community
Magento Community
 
Appmerce
Guru
 
Avatar
Total Posts:  376
Joined:  2008-05-13
Amsterdam, The Netherlands
 

I get the same problem with my new hoster, with Magento stable 1.0.19870.4

I’ve tried everything: localhost, localhost:3307, other ports, /var/run/mysqld/mysqld.sock and whatever I could think of. So apparently this problem still occurs under specific circumstances.

Am waiting for a reply from my hoster. Post back soon.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Appmerce
Guru
 
Avatar
Total Posts:  376
Joined:  2008-05-13
Amsterdam, The Netherlands
 

Use /var/lib/mysql/mysql.sock if nothing else works (which is different from the suggested /var/run/mysqld/mysqld.sock).

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top