Can’t create table wp_wc_download_log errno: 150 Foreign key constraint
-
Hello,
after backing up all databases:
mysqldump -uroot -ppass --all-databases | gzip > "all_databases.gz"
Restoring databases where WooCommerce is present causes the following error. All other databases are restored successfully.
gunzip -c all_databases.gz | sed -n '/^-- Current Database: 'mydb'/,/^-- Current Database: '/p' | gzip -9 > mydb.sql.gz gunzip < mydb.sql.gz | mysql -uuser -ppass --default-character-set=utf8mb4 ERROR 1005 (HY000) at line 1085: Can't create table 'mydb'.'wp_wc_download_log' (errno: 150 "Foreign key constraint is incorrectly formed") SHOW ENGINE INNODB STATUS LATEST FOREIGN KEY ERROR ------------------------ 2021-04-19 10:47:07 0x150a00974700 Error in foreign key constraint of table 'mydb'.'wp_wc_download_log': Create table 'mydb'.'wp_wc_download_log' with foreign key constraint failed. Referenced table 'mydb'.'wp_woocommerce_downloadable_product_permissions' not found in the data dictionary near ' FOREIGN KEY ('permission_id') REFERENCES 'wp_woocommerce_downloadable_product_permissions' ('permission_id') ON DELETE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci'.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Can’t create table wp_wc_download_log errno: 150 Foreign key constraint’ is closed to new replies.