It doesn't work for me ...
when I import one of my old mysql database directly into another new mysql database.
mysql -uusername -ppassword flarum < flarum_init.sql
DEBUG
SHOW ENGINE INNODB STATUS\G;
...
LATEST FOREIGN KEY ERROR
2019-07-23 11:13:58 0x700000f71000 Error in foreign key constraint of table flarum/discussions:
FOREIGN KEY (first_post_id
) REFERENCES posts
(id
) ON DELETE SET NULL,
CONSTRAINT discussions_hidden_user_id_foreign
FOREIGN KEY (hidden_user_id
) REFERENCES users
(id
) ON DELETE SET NULL,
CONSTRAINT discussions_last_post_id_foreign
FOREIGN KEY (last_post_id
) REFERENCES posts
(id
) ON DELETE SET NULL,
CONSTRAINT discussions_last_posted_user_id_foreign
FOREIGN KEY (last_posted_user_id
) REFERENCES users
(id
) ON DELETE SET NULL,
CONSTRAINT discussions_user_id_foreign
FOREIGN KEY (user_id
) REFERENCES users
(id
) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci:
Cannot resolve table name close to:
(id
) ON DELETE SET NULL,
CONSTRAINT discussions_hidden_user_id_foreign
FOREIGN KEY (hidden_user_id
) REFERENCES users
(id
) ON DELETE SET NULL,
CONSTRAINT discussions_last_post_id_foreign
FOREIGN KEY (last_post_id
) REFERENCES posts
(id
) ON DELETE SET NULL,
CONSTRAINT discussions_last_posted_user_id_foreign
FOREIGN KEY (last_posted_user_id
) REFERENCES users
(id
) ON DELETE SET NULL,
CONSTRAINT discussions_user_id_foreign
FOREIGN KEY (user_id
) REFERENCES users
(id
) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci
...
$mysql -V
mysql Ver 14.14 Distrib 5.7.9, for osx10.9 (x86_64) using EditLine wrapper
All of my tables are InnoDB