Problem mit der databaseverbindung, bei dem die Live-Site auf den lokalen Host migriert wird

Hier für ein paar Tage den Kopf gegen die Wand schlagen. Ich habe eine Multi-Site-Installation live und versuche, sie auf einen Localhost in meinem Netzwerk herunter zu ziehen, da die Site nicht aktiv ist und ich sie beibehalten möchte. localhost ist eine Linux-Box mit 16.04 mit:

  • php Version 5.6.29-1+deb.sury.org~xenial+1
  • apache2 2.4.18
  • mySQL 14.14 Distrib 5.7.16

Der Live-Server läuft: – php Version 5.4.29mySQL 14.14 Distrib 5.5.52 – Ich finde nicht heraus, wie ich herausfinden kann, welche Version von apache auf dem Live-Server läuft.

Hier ist, was ich getan habe, um zu migrieren:

  1. Die mySQL database wurde über cPanel
  2. Installierte mySQL , apache2 , etc. auf localhost
  3. Importierte die database in mySQL auf localhost
  4. Kopierte jede Datei von meiner Live-Site auf localhost
  5. Bearbeitet /etc/hosts zu Punkt 127.0.0.1 yyz.com , um die Subdomains auf der aktuellen Site zu verwalten.
  6. Ran chgrp , damit www-data Gruppenzugriff auf die Ordner und Dateien auf dem lokalen Host haben.
  7. Ran chmod 775 für die Ordner und Dateien des localhost
  8. Kann bestätigen, dass localhost html und php Dateien php .
  9. Habe alle Instanzen von wp_*_options siteurl , dass sie auf yyz.com
  10. Ich habe die databaseverbindung über php getestet und es gibt korrekte Tabellenzählungen zurück. Ich habe dies mit einer .php Datei gemacht, die von yyz.com ( yyz.com/sql.php )
  11. Ich habe DB_NAME , DB_USER , DB_PASSWORD und DB_HOST in wp-config.php , um ein Benutzerkonto zu reflektieren, das korrekte Zugriffsrechte hat.
  12. Ich habe .htaccess auf localhost gelöscht

Wenn ich zu yyz.com oder localhost oder 127.0.0.1 gehe, yyz.com ich:

databaseverbindung fehlgeschlagen

Wenn ich zu yyz.com/wp-admin/ oder localhost/wp-admin/ oder 127.0.0.1/wp-admin/ gehe, yyz.com/wp-admin/ ich:

Eine oder mehrere databasetabellen sind nicht verfügbar. Die database muss möglicherweise repariert werden.

Wenn ich versuche, die database zu reparieren, erhalte ich eine Reihe von Fehlern, die ich nicht erhalte, wenn ich die database auf der Live-Site repariere:

 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 

Übertrieben frustriert an dieser Stelle. Jede Hilfe wird geschätzt. Könnte es die Versionsunterschiede in mySQL oder PHP ? Das wird schwierig, wenn nicht unmöglich für mich sein, auf dem localhost zu beheben, da es mySQL für andere Anwendungen verwendet.

Solutions Collecting From Web of "Problem mit der databaseverbindung, bei dem die Live-Site auf den lokalen Host migriert wird"