Migrating Home Assistant from a Raspberry Pi 3B+ to VirtualBox on OS X
So I had just exported a MySQL database, and immediately re-imported it to the same server into a new database. The import failed with an error:
MySQL said:  #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1

MySQL error #1064 after a failed import
I puzzled over this for a while, but after expanding and looking at the end of the SQL file discovered this:

This MySQL server didn’t stick around to finish the export
As you can see from that chunk of HTML at the end of the file, the MySQL server had crapped out midway through the export. Re-exporting the database solved the problem.
Possibly related