我已按照相对简单的步骤将 Magento 2 站点从我的本地主机迁移到实时服务器。当我输入新 URL 以查看该站点时,我看到一个错误屏幕,其中有一条消息将我引导至错误日志。
从错误日志中我看到以下错误消息:
a:4:{i:0;s:48:"SQLSTATE[HY000] [2002] No such file or directory";i:1;s:3133:"#0 /homepages/25/d336955856/htdocs/mfg_oldSite/product-catalog/lib/Zend/Db/Adapter/Pdo/Mysql.php(111): Zend_Db_Adapter_Pdo_Abstract->_connect()
由于此错误,我无法访问任何常规公共(public)页面。我在尝试访问管理页面时也收到 404 错误。
有什么想法吗?需要任何进一步的信息来阐明我的问题吗?
最佳答案
检查 /app/etc/local.xml
中的 host
设置
Try with changing it from "localhost" to "your server host"
看看PDOException SQLSTATE[HY000] [2002] No such file or directory
编辑
根据我们所做的整个讨论。我假设您有错误的凭据。这就是您无法连接到您的数据库的原因。
关于database - 将 Magento 站点从 Localhost 迁移到 Live。获取和错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33267153/