Magento - Create new user returns SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' Help?
I'm at my wits end with this one. Everything else on this new live site works flawlessly exc开发者_开发问答ept this one issue. I can't create new customer accounts without it returning this error. I've tried everything I can think of in my own wheelhouse. Any suggestions? Magento forums are a wash for support.
SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
Trace:
#0 /home/orangeav/public_html/store/lib/Zend/Db/Adapter/Pdo/Mysql.php(96): Zend_Db_Adapter_Pdo_Abstract->_connect()
#1 /home/orangeav/public_html/store/lib/Varien/Db/Adapter/Pdo/Mysql.php(251): Zend_Db_Adapter_Pdo_Mysql->_connect()
#2 /home/orangeav/public_html/store/lib/Zend/Db/Adapter/Abstract.php(448): Varien_Db_Adapter_Pdo_Mysql->_connect()
#3 /home/orangeav/public_html/store/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('SET NAMES utf8', Array)
#4 /home/orangeav/public_html/store/lib/Varien/Db/Adapter/Pdo/Mysql.php(333): Zend_Db_Adapter_Pdo_Abstract->query('SET NAMES utf8', Array)
#5 /home/orangeav/public_html/store/app/code/core/Mage/Core/Model/Resource/Type/Db/Pdo/Mysql.php(45): Varien_Db_Adapter_Pdo_Mysql->query('SET NAMES utf8')
#6 /home/orangeav/public_html/store/app/code/core/Mage/Core/Model/Resource.php(93): Mage_Core_Model_Resource_Type_Db_Pdo_Mysql->getConnection(Object(Mage_Core_Model_Config_Element))
#7 /home/orangeav/public_html/store/app/code/core/Mage/Core/Model/Mysql4/Abstract.php(297): Mage_Core_Model_Resource->getConnection('core_read')
#8 /home/orangeav/public_html/store/app/code/core/Mage/Core/Model/Mysql4/Abstract.php(312): Mage_Core_Model_Mysql4_Abstract->_getConnection('read')
#9 /home/orangeav/public_html/store/app/code/core/Mage/Core/Model/Mysql4/Abstract.php(332): Mage_Core_Model_Mysql4_Abstract->_getReadAdapter()
#10 /home/orangeav/public_html/store/app/code/core/Mage/Core/Model/Mysql4/Collection/Abstract.php(97): Mage_Core_Model_Mysql4_Abstract->getReadConnection()
#11 /home/orangeav/public_html/store/app/code/core/Mage/Core/Model/Config.php(1206): Mage_Core_Model_Mysql4_Collection_Abstract->__construct(Object(Mage_Core_Model_Mysql4_Website))
#12 /home/orangeav/public_html/store/app/code/core/Mage/Core/Model/Config.php(1239): Mage_Core_Model_Config->getModelInstance('core_mysql4/web...', Object(Mage_Core_Model_Mysql4_Website))
#13 /home/orangeav/public_html/store/app/Mage.php(460): Mage_Core_Model_Config->getResourceModelInstance('core/website_co...', Object(Mage_Core_Model_Mysql4_Website))
#14 /home/orangeav/public_html/store/app/code/core/Mage/Core/Model/Abstract.php(208): Mage::getResourceModel('core/website_co...', Object(Mage_Core_Model_Mysql4_Website))
#15 /home/orangeav/public_html/store/app/code/core/Mage/Core/Model/Abstract.php(213): Mage_Core_Model_Abstract->getResourceCollection()
#16 /home/orangeav/public_html/store/app/code/core/Mage/Core/Model/App.php(532): Mage_Core_Model_Abstract->getCollection()
#17 /home/orangeav/public_html/store/app/code/core/Mage/Core/Model/App.php(393): Mage_Core_Model_App->_initStores()
#18 /home/orangeav/public_html/store/app/code/core/Mage/Core/Model/App.php(299): Mage_Core_Model_App->_initCurrentStore('', 'store')
#19 /home/orangeav/public_html/store/app/Mage.php(596): Mage_Core_Model_App->run(Array)
#20 /home/orangeav/public_html/store/index.php(80): Mage::run('', 'store)
#21 {main}
This is the code I get after trying to create a customer account, as a normal customer would when visiting the site. This is the latest version of Magento (1.4.1.1) without any updates applied. There are no extensions installed and all my styling and themes are being done semantically and using the correct theme structure. If it matters, I can bypass this error by requiring customers to validate accounts through email -- it's as if being redirected to the dashboard is causing the issue, as bypassing that step means you miss the page where this error is displayed.
I sincerely apologize for not being more descriptive in my original question. For now, the problem isn't much of an issue, as customers aren't seeing the screen, but it's inconvenient that they should require account confirmation before being able to log in and place an order, so I would love to fix this if possible.
Thank you for any assistance. I appreciate the time and effort.
The mysql socket layer was lost,you can recreate it.
ln -s /tmp/mysql.sock /var/lib/mysql/mysql.sock
精彩评论