没有这样的文件或目录 - Magento Error

时间:2015-06-27 22:08:56

标签: php magento zend-framework

我收到以下错误:

a:4:{i:0;s:48:"SQLSTATE[HY000] [2002] No such file or directory";i:1;s:2322:"#0 /home/blahblahblah/public_html/lib/Zend/Db/Adapter/Pdo/Mysql.php(96): Zend_Db_Adapter_Pdo_Abstract->_connect()
#1 /home/blahblahblah/public_html/lib/Varien/Db/Adapter/Pdo/Mysql.php(300): Zend_Db_Adapter_Pdo_Mysql->_connect()
#2 /home/blahblahblah/public_html/lib/Zend/Db/Adapter/Abstract.php(459): Varien_Db_Adapter_Pdo_Mysql->_connect()
#3 /home/blahblahblah/public_html/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('SET NAMES utf8', Array)
#4 /home/blahblahblah/public_html/lib/Varien/Db/Adapter/Pdo/Mysql.php(389): Zend_Db_Adapter_Pdo_Abstract->query('SET NAMES utf8', Array)
#5 /home/blahblahblah/public_html/app/code/core/Mage/Core/Model/Resource.php(169): Varien_Db_Adapter_Pdo_Mysql->query('SET NAMES utf8')
#6 /home/blahblahblah/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/blahblahblah/public_html/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php(320): Mage_Core_Model_Resource->getConnection('core_read')
#8 /home/blahblahblah/public_html/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php(335): Mage_Core_Model_Resource_Db_Abstract->_getConnection('read')
#9 /home/blahblahblah/public_html/app/code/core/Mage/Core/Model/Resource/Cache.php(53): Mage_Core_Model_Resource_Db_Abstract->_getReadAdapter()
#10 /home/blahblahblah/public_html/app/code/core/Mage/Core/Model/Cache.php(449): Mage_Core_Model_Resource_Cache->getAllOptions()
#11 /home/blahblahblah/public_html/app/code/core/Mage/Core/Model/Cache.php(491): Mage_Core_Model_Cache->_initOptions()
#12 /home/blahblahblah/public_html/app/code/core/Mage/Core/Model/App.php(1175): Mage_Core_Model_Cache->canUse('config')
#13 /home/blahblahblah/public_html/app/code/core/Mage/Core/Model/Config.php(414): Mage_Core_Model_App->useCache('config')
#14 /home/blahblahblah/public_html/app/code/core/Mage/Core/Model/Config.php(294): Mage_Core_Model_Config->_canUseCacheForInit()
#15 /home/blahblahblah/public_html/app/code/core/Mage/Core/Model/App.php(408): Mage_Core_Model_Config->loadModulesCache()
#16 /home/blahblahblah/public_html/app/code/core/Mage/Core/Model/App.php(338): Mage_Core_Model_App->_initModules()
#17 /home/blahblahblah/public_html/app/Mage.php(640): Mage_Core_Model_App->run(Array)
#18 /home/blahblahblah/public_html/index.php(128): Mage::run('', 'store')
#19 {main}";s:3:"url";s:1:"/";s:11:"script_name";s:10:"/index.php";}

我已检查/home/blahblahblah/public_html/lib/Zend/Db/Adapter/Pdo/Mysql.php是否存在,并且所有目录的权限都是755,文件设置为644.

我已经做了我能想到的一切,也许其他人有什么可能导致这个问题的线索?

我也忘了提到文件所有权也属于正确的用户。我使用rSync将整个目录移动到新服务器。我从服务器上安装它的工作正常。

1 个答案:

答案 0 :(得分:3)

您似乎尝试通过套接字连接到mysql但失败了。 Mysql是否正常运行并且您的配置正确。

错误来自你提到的文件,所以这不是问题,Magento确实看到了该文件。

<强>解决方案

尝试使用IP连接到Mysql。或者检查你的mysql-socket是否正确。