I cannot get mysqldump to generate a dump that will properly restore. The dump is being generated to setup a new slave, but whenever the slave starts up, it gets foreign key constraint failures.
I'm generating the dump with slave positions and as a single transaction so that the dump is (allegedly) atomic, but when I essentially execute the following:
mysqldump \ -h master \ --flush-logs --single-transaction --master-data \ --apply-slave-statements \ --databases my-db \ | mysql -h slave
I get the following error when I "SHOW SLAVE STATUS":
Last_Errno: 1452 Last_Error: Error 'Cannot add or update a child row: a foreign key constraint fails ...
All of the tables use the InnoDB engine, and the foreign key is an integer.
Using MariaDB 10.3.