Faced the same issue. Indeed it was wrong SQL at the beginning of the file because when dumping I did:
mysqldump -u username --password=password db_name > dump.sql
Which wrote at the beginning of the file something that was in stdout which was:
mysqldump: [Warning] Using a password on the command line interface can be insecure.
Resulting in the restore raising that error.
So deleting the first line of the SQL dump enables a proper restore.
Looking at the way the restore was done in the original question, there is a high chance the dump was done similarly as mine, causing a stdout warning printing in the SQL file (if ever mysqldump was printing it back then).