zillabuggs Posted June 20, 2012 Share Posted June 20, 2012 I'm very new to this and getting the following error when trying to import database. Below is the content of the message. Any help would be appreciated. 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 SQL query: -- MySQL dump 10.13 Distrib 5.1.49, for debian-linux-gnu (i486) -- -- Host: justcatchatcom.fatcowmysql.com Database: wrd_heo6cg7l32 -- ------------------------------------------------------ -- Server version 5.1.53-log /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; Link to comment https://forums.phpfreaks.com/topic/264500-help-to-solve-1064-error-please/ Share on other sites More sharing options...
PFMaBiSmAd Posted June 20, 2012 Share Posted June 20, 2012 The  characters are the utf-8 Byte Order Mark (BOM) characters. I'm guessing you have opened the file in your editor and it got saved with the BOM. You need to save the file without the BOM characters. Your editor should have a choice under the 'save as' menu or under a character encoding menu to save the file without the BOM. Link to comment https://forums.phpfreaks.com/topic/264500-help-to-solve-1064-error-please/#findComment-1355466 Share on other sites More sharing options...
zillabuggs Posted June 20, 2012 Author Share Posted June 20, 2012 Hi. The save as options I have are: ANSI, Unicode, Unicode big endian and UTF-8. I tried saving it again with the UTF-8 and importing again, but am getting the same message. Link to comment https://forums.phpfreaks.com/topic/264500-help-to-solve-1064-error-please/#findComment-1355476 Share on other sites More sharing options...
PFMaBiSmAd Posted June 20, 2012 Share Posted June 20, 2012 That sounds like MS Notepad. If your file only contains ASCII characters, you can use the ANSI selection. If you have UTF-8 encoded data, don't use the ANSI selection. You should not try to use MS Notepad as a programming editor. I recommend using Notepad++. It will allow you to save your file without the BOM characters. Link to comment https://forums.phpfreaks.com/topic/264500-help-to-solve-1064-error-please/#findComment-1355578 Share on other sites More sharing options...
zillabuggs Posted June 21, 2012 Author Share Posted June 21, 2012 Hi again. I downloaded notepad++ and tried saving and importing the database again. Still getting the same error. Can I ask a stupid question though. To return this error, should these characters actually appear in the database somewhere, as I cannot see them anywhere? Link to comment https://forums.phpfreaks.com/topic/264500-help-to-solve-1064-error-please/#findComment-1355710 Share on other sites More sharing options...
PFMaBiSmAd Posted June 21, 2012 Share Posted June 21, 2012 The characters are part of the file and are at the very beginning of the saved file. They are put there by editors when they detect a file contains UTF-8 encoded characters. Using notepad++, there is an 'Encoding' menu in the top menu bar. When you open your file, it should show the 'Encode in UTF-8' item selected. Pick the setting right above that one, 'Encode in UTF-8 without BOM', and save the file. Link to comment https://forums.phpfreaks.com/topic/264500-help-to-solve-1064-error-please/#findComment-1355746 Share on other sites More sharing options...
zillabuggs Posted June 21, 2012 Author Share Posted June 21, 2012 Thankyou. I have now managed to import my database. Your help is very much appreciated. Link to comment https://forums.phpfreaks.com/topic/264500-help-to-solve-1064-error-please/#findComment-1355870 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.