0

I've my magento 1 installed since 5 months and I never had a problem, all was working fine. Today with no reason I can't access to my installation, frontend and backend made the same error ad stop the execution.

This is the error:

a:4:{i:0;s:95:"SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)";i:1;s:2994:"
#0 /home/xp1qh8ju/public_html/lib/Zend/Db/Adapter/Pdo/Mysql.php(111): Zend_Db_Adapter_Pdo_Abstract->_connect()
#1 /home/xp1qh8ju/public_html/lib/Varien/Db/Adapter/Pdo/Mysql.php(396): Zend_Db_Adapter_Pdo_Mysql->_connect()
#2 /home/xp1qh8ju/public_html/lib/Zend/Db/Adapter/Abstract.php(460): Varien_Db_Adapter_Pdo_Mysql->_connect()
#3 /home/xp1qh8ju/public_html/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('SET NAMES utf8', Array)
#4 /home/xp1qh8ju/public_html/lib/Varien/Db/Adapter/Pdo/Mysql.php(504): Zend_Db_Adapter_Pdo_Abstract->query('SET NAMES utf8', Array)
#5 /home/xp1qh8ju/public_html/app/code/core/Mage/Core/Model/Resource.php(179): Varien_Db_Adapter_Pdo_Mysql->query('SET NAMES utf8')
#6 /home/xp1qh8ju/public_html/app/code/core/Mage/Core/Model/Resource.php(110): Mage_Core_Model_Resource->_newConnection('pdo_mysql', Object(Mage_Core_Model_Config_Element))
#7 /home/xp1qh8ju/public_html/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php(320): Mage_Core_Model_Resource->getConnection('core_write')
#8 /home/xp1qh8ju/public_html/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php(350): Mage_Core_Model_Resource_Db_Abstract->_getConnection('write')
#9 /home/xp1qh8ju/public_html/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php(335): Mage_Core_Model_Resource_Db_Abstract->_getWriteAdapter()
#10 /home/xp1qh8ju/public_html/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php(360): Mage_Core_Model_Resource_Db_Abstract->_getReadAdapter()
#11 /home/xp1qh8ju/public_html/app/code/core/Mage/Core/Model/Resource/Db/Collection/Abstract.php(134): Mage_Core_Model_Resource_Db_Abstract->getReadConnection()
#12 /home/xp1qh8ju/public_html/app/code/core/Mage/Core/Model/Config.php(1357): Mage_Core_Model_Resource_Db_Collection_Abstract->__construct(Object(Mage_Core_Model_Resource_Website))
#13 /home/xp1qh8ju/public_html/app/code/core/Mage/Core/Model/Config.php(1389): Mage_Core_Model_Config->getModelInstance('core_resource/w...', Object(Mage_Core_Model_Resource_Website))
#14 /home/xp1qh8ju/public_html/app/Mage.php(491): Mage_Core_Model_Config->getResourceModelInstance('core/website_co...', Object(Mage_Core_Model_Resource_Website))
#15 /home/xp1qh8ju/public_html/app/code/core/Mage/Core/Model/Abstract.php(208): Mage::getResourceModel('core/website_co...', Object(Mage_Core_Model_Resource_Website))
#16 /home/xp1qh8ju/public_html/app/code/core/Mage/Core/Model/Abstract.php(213): Mage_Core_Model_Abstract->getResourceCollection()
#17 /home/xp1qh8ju/public_html/app/code/core/Mage/Core/Model/App.php(619): Mage_Core_Model_Abstract->getCollection()
#18 /home/xp1qh8ju/public_html/app/code/core/Mage/Core/Model/App.php(477): Mage_Core_Model_App->_initStores()
#19 /home/xp1qh8ju/public_html/app/code/core/Mage/Core/Model/App.php(360): Mage_Core_Model_App->_initCurrentStore('', 'store')
#20 /home/xp1qh8ju/public_html/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#21 /home/xp1qh8ju/public_html/index.php(94): Mage::run('', 'store')
#22 {main}";s:3:"url";s:6:"/admin";s:11:"script_name";s:10:"/index.php";}

Anyone knows how to solve this problem?

asked Mar 2, 2017 at 9:16

1 Answer 1

0

It may be due to various reasons. The first thing you have to do is to restart your MySQL server. The command may depend on the Linux distribution you're using, but it's something like:

sudo service mysql restart

So, why it could happen: - Your MySQL died for various reason (out-of-memory, bug...) - You've run out of connections (reached max-connections limit defined in my.cnf)

answered Mar 2, 2017 at 10:21

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.