By Brian Wright on Saturday, 28 March 2015
Category: How To

MySQL Import of SQL file fails with error 1064

On a number of occasions I have attempted to import an exported MySQL database file and received the following message.

/* SQL Error (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 '?# -------------------------------------------------------- # Host:     ' at line 1 */
/* Error with snippets directory: The specified path was not found */

# --------------------------------------------------------
# Host:                         127.0.0.1
# Server version:               5.5.40 - MySQL Community Server (GPL)
# Server OS:                    Win32
# HeidiSQL version:             7.0.0.4053
# Date/time:                    2014-01-20 09:48:36
# --------------------------------------------------------

You would think after completing this many times I would remember what to do. But inevitably I forget one critical step and have to search all over the web for the solution. I'm sure I am not alone with this issue so I am posting this for my quick reference but also for anyone else that has the same issue.

If you have exported the database and then want to import it back into the existing database or into another one, there is a good chance that this error is incorrect and that there is nothing wrong with the file. So, the key to running this import is that you must select the file type as UTF-8 when you open the file. I found that with both, MyPHPAdmin and HeidiSQL, setting this option resolves the file import issue.

We hope that this information is helpful. Please let us know how this has helped you or if you have additional questions. As always Firestone Technical Resources, Inc. is here to help with your computer support issues - "Providing personal service for your impersonal technology."

Related Posts

Leave Comments