SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MO
This is kind of a response to @peter-moses, as I had exactly the same issues as he did.
I solved that problem by adding --add-drop-database
to my dump command. Its documented here: https://mariadb.com/kb/en/mysqldump/
My final command looks like this:
mysqldump -uroot -ppassword --single-transaction --all-databases --add-drop-database