在这里我的头撞了几天墙。我有一个多站点实时安装,正在尝试将其下拉到网络上的本地主机,因为该站点不活动,我想保留它。localhost
是一个运行16.04的linux机箱,具有:
php Version 5.6.29-1+deb.sury.org~xenial+1
apache2 2.4.18
mySQL 14.14 Distrib 5.7.16
实时服务器正在运行:-
php Version 5.4.29
-
mySQL 14.14 Distrib 5.5.52
- 我不知道如何找出
apache
正在live server上运行。
以下是我为迁移所做的工作:
将mySQL
数据库通过cPanel
已安装mySQL
, apache2
, 等打开localhost
将数据库导入mySQL
在…上localhost
将我的live站点中的每个文件复制到localhost
已编辑/etc/hosts
到点127.0.0.1 yyz.com
维护当前站点上的子域
冉chgrp
允许www-data
对本地主机上的文件夹和文件进行组访问冉chmod 775
在localhost的文件夹和文件上,可以确认localhost正在服务html
和php
文件已更改的所有实例wp_*_options
siteurl
指向yyz.com
我已通过测试数据库连接php
并返回正确的表计数。我用一个.php
文件送达时间yyz.com
(yyz.com/sql.php
)我已经更改了DB_NAME
, DB_USER
, DB_PASSWORD
和DB_HOST
在里面wp-config.php
以反映具有适当访问权限的用户帐户我已删除.htaccess
在…上localhost
当我去yyz.com
或localhost
或127.0.0.1
我得到:Error establishing a database connection
如果我去yyz.com/wp-admin/
或localhost/wp-admin/
或127.0.0.1/wp-admin/
我得到:One or more database tables are unavailable. The database may need to be repaired.
如果我尝试修复数据库,我会遇到许多错误,而如果我在live site上修复数据库,我不会遇到这些错误:WordPress database error: [Table \'yyz.wp_options\' doesn\'t exist]
SELECT option_value FROM wp_options WHERE option_name = \'siteurl\' LIMIT 1
WordPress database error: [Table \'yyz.wp_options\' doesn\'t exist]
SELECT option_value FROM wp_options WHERE option_name = \'active_plugins\' LIMIT 1
WordPress database error: [Table \'yyz.wp_options\' doesn\'t exist]
SELECT option_value FROM wp_options WHERE option_name = \'hack_file\' LIMIT 1
WordPress database error: [Table \'yyz.wp_options\' doesn\'t exist]
SELECT option_value FROM wp_options WHERE option_name = \'blog_charset\' LIMIT 1
WordPress database error: [Table \'yyz.wp_options\' doesn\'t exist]
SELECT option_value FROM wp_options WHERE option_name = \'permalink_structure\' LIMIT 1
WordPress database error: [Table \'yyz.wp_options\' doesn\'t exist]
SELECT option_value FROM wp_options WHERE option_name = \'wp_user_roles\' LIMIT 1
WordPress database error: [Table \'yyz.wp_options\' doesn\'t exist]
SELECT option_value FROM wp_options WHERE option_name = \'template\' LIMIT 1
WordPress database error: [Table \'yyz.wp_options\' doesn\'t exist]
SELECT option_value FROM wp_options WHERE option_name = \'stylesheet\' LIMIT 1
WordPress database error: [Table \'yyz.wp_options\' doesn\'t exist]
SELECT option_value FROM wp_options WHERE option_name = \'category_base\' LIMIT 1
WordPress database error: [Table \'yyz.wp_options\' doesn\'t exist]
SELECT option_value FROM wp_options WHERE option_name = \'tag_base\' LIMIT 1
WordPress database error: [Table \'yyz.wp_options\' doesn\'t exist]
SELECT option_value FROM wp_options WHERE option_name = \'link_manager_enabled\' LIMIT 1
WordPress database error: [Table \'yyz.wp_options\' doesn\'t exist]
SELECT option_value FROM wp_options WHERE option_name = \'sidebars_widgets\' LIMIT 1
WordPress database error: [Table \'yyz.wp_options\' doesn\'t exist]
SELECT option_value FROM wp_options WHERE option_name = \'widget_pages\' LIMIT 1
WordPress database error: [Table \'yyz.wp_options\' doesn\'t exist]
SELECT option_value FROM wp_options WHERE option_name = \'widget_calendar\' LIMIT 1
WordPress database error: [Table \'yyz.wp_options\' doesn\'t exist]
SELECT option_value FROM wp_options WHERE option_name = \'widget_archives\' LIMIT 1
WordPress database error: [Table \'yyz.wp_options\' doesn\'t exist]
SELECT option_value FROM wp_options WHERE option_name = \'widget_links\' LIMIT 1
WordPress database error: [Table \'yyz.wp_options\' doesn\'t exist]
SELECT option_value FROM wp_options WHERE option_name = \'widget_meta\' LIMIT 1
WordPress database error: [Table \'yyz.wp_options\' doesn\'t exist]
SELECT option_value FROM wp_options WHERE option_name = \'widget_search\' LIMIT 1
WordPress database error: [Table \'yyz.wp_options\' doesn\'t exist]
SELECT option_value FROM wp_options WHERE option_name = \'widget_text\' LIMIT 1
WordPress database error: [Table \'yyz.wp_options\' doesn\'t exist]
SELECT option_value FROM wp_options WHERE option_name = \'widget_categories\' LIMIT 1
WordPress database error: [Table \'yyz.wp_options\' doesn\'t exist]
SELECT option_value FROM wp_options WHERE option_name = \'widget_recent-posts\' LIMIT 1
WordPress database error: [Table \'yyz.wp_options\' doesn\'t exist]
SELECT option_value FROM wp_options WHERE option_name = \'widget_recent_entries\' LIMIT 1
WordPress database error: [Table \'yyz.wp_options\' doesn\'t exist]
SELECT option_value FROM wp_options WHERE option_name = \'widget_recent-comments\' LIMIT 1
WordPress database error: [Table \'yyz.wp_options\' doesn\'t exist]
SELECT option_value FROM wp_options WHERE option_name = \'widget_recent_comments\' LIMIT 1
WordPress database error: [Table \'yyz.wp_options\' doesn\'t exist]
SELECT option_value FROM wp_options WHERE option_name = \'widget_rss\' LIMIT 1
WordPress database error: [Table \'yyz.wp_options\' doesn\'t exist]
SELECT option_value FROM wp_options WHERE option_name = \'widget_tag_cloud\' LIMIT 1
WordPress database error: [Table \'yyz.wp_options\' doesn\'t exist]
SELECT option_value FROM wp_options WHERE option_name = \'widget_nav_menu\' LIMIT 1
WordPress database error: [Table \'yyz.wp_options\' doesn\'t exist]
SELECT option_value FROM wp_options WHERE option_name = \'use_smilies\' LIMIT 1
WordPress database error: [Table \'yyz.wp_options\' doesn\'t exist]
SELECT option_value FROM wp_options WHERE option_name = \'cron\' LIMIT 1
WordPress database error: [Table \'yyz.wp_options\' doesn\'t exist]
INSERT INTO `wp_options` (`option_name`, `option_value`, `autoload`) VALUES (\'cron\', \'a:2:{i:1484715804;a:1:{s:16:\\"wp_version_check\\";a:1:{s:32:\\"40cd750bba9870f18aada2478b24840a\\";a:3:{s:8:\\"schedule\\";s:10:\\"twicedaily\\";s:4:\\"args\\";a:0:{}s:8:\\"interval\\";i:43200;}}}s:7:\\"version\\";i:2;}\', \'yes\') ON DUPLICATE KEY UPDATE `option_name` = VALUES(`option_name`), `option_value` = VALUES(`option_value`), `autoload` = VALUES(`autoload`)
WordPress database error: [Table \'yyz.wp_options\' doesn\'t exist]
INSERT INTO `wp_options` (`option_name`, `option_value`, `autoload`) VALUES (\'cron\', \'a:2:{i:1484715804;a:1:{s:17:\\"wp_update_plugins\\";a:1:{s:32:\\"40cd750bba9870f18aada2478b24840a\\";a:3:{s:8:\\"schedule\\";s:10:\\"twicedaily\\";s:4:\\"args\\";a:0:{}s:8:\\"interval\\";i:43200;}}}s:7:\\"version\\";i:2;}\', \'yes\') ON DUPLICATE KEY UPDATE `option_name` = VALUES(`option_name`), `option_value` = VALUES(`option_value`), `autoload` = VALUES(`autoload`)
WordPress database error: [Table \'yyz.wp_options\' doesn\'t exist]
INSERT INTO `wp_options` (`option_name`, `option_value`, `autoload`) VALUES (\'cron\', \'a:2:{i:1484715804;a:1:{s:16:\\"wp_update_themes\\";a:1:{s:32:\\"40cd750bba9870f18aada2478b24840a\\";a:3:{s:8:\\"schedule\\";s:10:\\"twicedaily\\";s:4:\\"args\\";a:0:{}s:8:\\"interval\\";i:43200;}}}s:7:\\"version\\";i:2;}\', \'yes\') ON DUPLICATE KEY UPDATE `option_name` = VALUES(`option_name`), `option_value` = VALUES(`option_value`), `autoload` = VALUES(`autoload`)
WordPress database error: [Table \'yyz.wp_options\' doesn\'t exist]
SELECT option_value FROM wp_options WHERE option_name = \'timezone_string\' LIMIT 1
WordPress database error: [Table \'yyz.wp_options\' doesn\'t exist]
SELECT option_value FROM wp_options WHERE option_name = \'gmt_offset\' LIMIT 1
WordPress database error: [Table \'yyz.wp_options\' doesn\'t exist]
INSERT INTO `wp_options` (`option_name`, `option_value`, `autoload`) VALUES (\'cron\', \'a:2:{i:1484768340;a:1:{s:20:\\"wp_maybe_auto_update\\";a:1:{s:32:\\"40cd750bba9870f18aada2478b24840a\\";a:3:{s:8:\\"schedule\\";s:10:\\"twicedaily\\";s:4:\\"args\\";a:0:{}s:8:\\"interval\\";i:43200;}}}s:7:\\"version\\";i:2;}\', \'yes\') ON DUPLICATE KEY UPDATE `option_name` = VALUES(`option_name`), `option_value` = VALUES(`option_value`), `autoload` = VALUES(`autoload`)
WordPress database error: [Table \'yyz.wp_options\' doesn\'t exist]
SELECT option_value FROM wp_options WHERE option_name = \'theme_switched\' LIMIT 1
( ! ) Warning: Cannot modify header information - headers already sent by (output started at /home/yyz/Applications/yyz/wp-includes/wp-db.php:1220) in /home/yyz/Applications/yyz/wp-admin/maint/repair.php on line 12
Call Stack
# Time Memory Function Location
1 0.0001 230104 {main}( ) .../repair.php:0
2 0.0289 1714280 header ( ) .../repair.php:12
WordPress database error: [Table \'yyz.wp_options\' doesn\'t exist]
SELECT option_value FROM wp_options WHERE option_name = \'html_type\' LIMIT 1
在这一点上感到困惑和沮丧。非常感谢您的帮助。可能是版本差异mySQL
或PHP
? 如果不是不可能的话,我很难在localhost
, 因为它正在使用mySQL
对于其他应用程序也是如此。