Guides › HTML / PHP sites › Backups & restore

MySQL Error 1064: SQL Syntax Error During Import

Version differences.

Reference guide. This guide is written from established practice and the official documentation of the tools involved. We have not yet tested every step on a live demo site. Back up your site before you change anything.
Backups and restore

Error 1064 means MySQL could not understand part of the SQL in your file. It usually happens when importing a dump from a different MySQL or MariaDB version.

1Read the message2Check for truncated files3Check version differences4Check the export settings5Check reserved words6Import in the right order7RetryFixed? Test the site. If not, get help.
The steps in order. Work down the list and stop when the problem is solved.

Step 1: Read the message

Illustration for Step 1: Read the message

It shows near '...' at line 42. Open the file and look at that line.

Step 2: Check for truncated files

Illustration for Step 2: Check for truncated files

A cut-off file ends mid-statement. Compare the file size to the original and re-export.

Step 3: Check version differences

Illustration for Step 3: Check version differences

Words such as utf8mb4_0900_ai_ci or ROW_FORMAT are not supported on older servers. Replace the collation with utf8mb4_unicode_ci.

Step 4: Check the export settings

Illustration for Step 4: Check the export settings

Re-export with compatibility set to MYSQL40 off, and without Add DROP and CREATE options that clash.

Step 5: Check reserved words

Illustration for Step 5: Check reserved words

Table or column names such as order need backticks.

Step 6: Import in the right order

Illustration for Step 6: Import in the right order

Create the empty database first and select it before importing.

Step 7: Retry

Illustration for Step 7: Retry

Import again after the edit.

Still stuck?

If these steps do not solve it, we fix it for you for a flat $99. Full refund if we do not solve it within 7 days.

Related guides

Did this solve it? If not, email hello@sitefixlab.org with the exact error text and we will look into it. Try the problem finder.

Last updated 2026-11-22.