When I run a mysqldump command on my database and then try to import it, it fails as it attempts to create the tables alphabetically, even though they may have a foreign key
This may happen if you use --compact as one of your mysqldump command.
--compact includes --skip-comments so instead --compact one should use --skip-add-drop-table --skip-add-locks --skip-disable-keys --skip-set-charset