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 */; Quote 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. Quote 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. Quote 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. Quote 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? Quote 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. Quote 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. Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.