简体   繁体   English

将多站点WordPress应用程序复制到新主机,连接数据库时出错

[英]Copied Multi-site WordPress Application to New Host, Error connecting to DB

I have copied a WordPress application to a new hosting environment. 我已将WordPress应用程序复制到新的托管环境。 The application has subdomains enabled, however our new hosting environment does not support this. 该应用程序启用了子域,但是我们的新托管环境不支持此功能。 I have updated .htaccess as well as wp-config.php to reflect the new URL and new database. 我已经更新了.htaccesswp-config.php以反映新的URL和新的数据库。 I am unable to navigate through the site whatsoever. 我无法浏览该网站。 Going to wp-admin leads me to the classic error message: 进入wp-admin会使我看到经典的错误消息:

Error establishing a database connection 建立数据库连接时出错
If your site does not display, please contact the owner of this network. 如果您的网站没有显示,请联系该网络的所有者。 If you are the owner of this network please check that MySQL is running properly and all tables are error free. 如果您是该网络的所有者,请检查MySQL是否正常运行并且所有表均无错误。

Could not find site example.com. 找不到网站example.com。 Searched for table wp_blogs in database wp. 在数据库wp中搜索表wp_blogs。 Is that right? 那正确吗?

What do I do now? 现在我该怎么做? Read the bug report page. 阅读错误报告页面。 Some of the guidelines there may help you figure out what went wrong. 那里的一些准则可能会帮助您找出问题所在。 If you're still stuck with this message, then check that your database contains the following tables: 如果您仍然对此消息感到困惑,请检查您的数据库是否包含下表:

wp_users
wp_usermeta
wp_blogs
wp_signups
wp_site
wp_sitemeta
wp_registration_log
wp_blog_versions

I imagine this has something to do with the URL mappings in the database. 我想这与数据库中的URL映射有关。 Keep in mind, we are trying to switch from subdomains to subdirectories. 请记住,我们正在尝试从子域切换到子目录。 What steps must I take to correct this in addition to switching over from subdomains? 除了从子域切换外,还必须采取什么步骤来更正此问题?

There are a few things you need to do to switch from subdomain to subdirectory. 从子域切换到子目录,需要做一些事情。

This forum topic should have most of the details needed: https://premium.wpmudev.org/forums/topic/reverting-from-subdomains-to-subdirectories-in-multistie 该论坛主题应具有所需的大多数详细信息: https : //premium.wpmudev.org/forums/topic/reverting-from-subdomains-to-subdirectories-in-multistie

That said when migrating to a new host with multisite and getting the DB connectivity errors, what usually is the cause is the mismatch in the wp_blogs & wp_sites tables. 也就是说,当迁移到具有多站点的新主机并获得数据库连接错误时,通常的原因是wp_blogs和wp_sites表中的不匹配。

If you can manually edit those tables and correct at least your primary domain you should be able to get back in and correct the rest via the network admin. 如果您可以手动编辑这些表并至少纠正您的主域,则应该可以通过网络管理员重新进入并纠正其余的域。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM