I had this issue on two different sites on two different occasions and hosts. When creating a database back-up through the Craft CMS admin and importing that SQL file into a new database through PhP MyAdmin I get syntax errors and import stops.

I tried backing up the database on both sites through the hosting company itself, which resulted in one backup working and one also giving the syntax error.

I just updated the sites to Craft 2.6.x.

Any ideas what goes wrong or how I can solve this? Do I need to manually go through the whole SQL file and fix the syntax errors manually? :/

When I open the SQL file in PhPStorm, it looks like the character where the error happens, all the SQL statements coming behind it are escaped wrong, they are shown as normal text. Maybe an encoding issue?

  • 1
    We've seen this a few times and it always involves phpMyAdmin and it appeared to be version specific (i.e. if they updated their phpMyAdmin version the error went away). So always just assumed it was a phpMyAdmin bug because the same backup imported fine through a "real" database client.
    – Brad Bell
    Feb 10 '17 at 6:48

As Brad replied as a comment, the issue was indeed PhPMyAdmin. Using NaviCat or updating my PhPMyAdmin resolved the issue.

Answer points go to Brad!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.