gpt4 book ai didi

mysql - Magento - 尽管在 local.xml 中设置了远程 IP,但仍尝试通过 unix 套接字进行连接

转载 作者:行者123 更新时间:2023-11-29 06:13:08 24 4
gpt4 key购买 nike

 <default_setup>
<connection>
<host><![CDATA[10.1.39.35]]></host>
<username><![CDATA[user]]></username>
<password><![CDATA[password]]></password>
<dbname><![CDATA[db_magento]]></dbname>
<active>1</active>
</connection>
</default_setup>

我的 local.xml 文件配置如上所示。我收到此错误

SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

Trace:
#0 /home/ecosmart/public_html/e-nrg.com/lib/Zend/Db/Adapter/Pdo/Mysql.php(96): Zend_Db_Adapter_Pdo_Abstract->_connect()
#1 /home/ecosmart/public_html/e-nrg.com/lib/Varien/Db/Adapter/Pdo/Mysql.php(251): Zend_Db_Adapter_Pdo_Mysql->_connect()
#2 /home/ecosmart/public_html/e-nrg.com/lib/Zend/Db/Adapter/Abstract.php(448): Varien_Db_Adapter_Pdo_Mysql->_connect()
#3 /home/ecosmart/public_html/e-nrg.com/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('SET NAMES utf8', Array)
#4 /home/ecosmart/public_html/e-nrg.com/lib/Varien/Db/Adapter/Pdo/Mysql.php(333): Zend_Db_Adapter_Pdo_Abstract->query('SET NAMES utf8', Array)
#5 /home/ecosmart/public_html/e-nrg.com/app/code/core/Mage/Core/Model/Resource/Type/Db/Pdo/Mysql.php(45): Varien_Db_Adapter_Pdo_Mysql->query('SET NAMES utf8')
#6 /home/ecosmart/public_html/e-nrg.com/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/ecosmart/public_html/e-nrg.com/app/code/core/Mage/Core/Model/Mysql4/Abstract.php(297): Mage_Core_Model_Resource->getConnection('core_read')
#8 /home/ecosmart/public_html/e-nrg.com/app/code/core/Mage/Core/Model/Mysql4/Abstract.php(312): Mage_Core_Model_Mysql4_Abstract->_getConnection('read')
#9 /home/ecosmart/public_html/e-nrg.com/app/code/core/Mage/Core/Model/Mysql4/Cache.php(41): Mage_Core_Model_Mysql4_Abstract->_getReadAdapter()
#10 /home/ecosmart/public_html/e-nrg.com/app/code/core/Mage/Core/Model/Cache.php(424): Mage_Core_Model_Mysql4_Cache->getAllOptions()
#11 /home/ecosmart/public_html/e-nrg.com/app/code/core/Mage/Core/Model/Cache.php(459): Mage_Core_Model_Cache->_initOptions()
#12 /home/ecosmart/public_html/e-nrg.com/app/code/core/Mage/Core/Model/App.php(1101): Mage_Core_Model_Cache->canUse('config')
#13 /home/ecosmart/public_html/e-nrg.com/app/code/core/Mage/Core/Model/Config.php(404): Mage_Core_Model_App->useCache('config')
#14 /home/ecosmart/public_html/e-nrg.com/app/code/core/Mage/Core/Model/Config.php(286): Mage_Core_Model_Config->_canUseCacheForInit()
#15 /home/ecosmart/public_html/e-nrg.com/app/code/core/Mage/Core/Model/App.php(359): Mage_Core_Model_Config->loadModulesCache()
#16 /home/ecosmart/public_html/e-nrg.com/app/code/core/Mage/Core/Model/App.php(295): Mage_Core_Model_App->_initModules()
#17 /home/ecosmart/public_html/e-nrg.com/app/Mage.php(596): Mage_Core_Model_App->run(Array)
#18 /home/ecosmart/public_html/e-nrg.com/index.php(83): Mage::run('', 'store')
#19 {main}

我一直在互联网上查找,但找不到与此有相同问题的人=每个人都说当他们在不同端口上运行本地 mysql 时会发生这种情况。我不是,我正在运行一个单独的服务器,其中的数据库通过内部网络联网。

有谁知道停止 magento 使用 MYSQL 套接字连接并强制其使用 TCP 协议(protocol)的解决方法吗?

谢谢

最佳答案

你清理缓存了吗? rm -rf var/cache

关于mysql - Magento - 尽管在 local.xml 中设置了远程 IP,但仍尝试通过 unix 套接字进行连接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8129626/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com