1

I have two servers, both running phpmyadmin, and I exported a mysql dump on one using the export tab on phpmyadmin, and I tried importing the query with phpmyadmin on the second site.

I get this 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 ' SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO"' at line 1

I've looked through the text file and there is absolutely no "" in there. I've deleted all the comments at the top just to make sure it isn't some weird kind of interpretation error.

If anyone has any ideas to make phpmyadmin actually import this, I'm all ears. Unfortunately, this is a cheap shared server, and I don't have a whole lot of tools at my disposal. I have FTP access, and phpmyadmin access, but not much else. I usually do this via SSH, unfortunately, they don't trust me with that kind of access.

Troy Knapp
  • 517
  • 3
  • 8
  • 17

1 Answers1

3

The  is indicative of a BOM. I don't know how it got there - mysqldump shouldn't do this. Maybe the file was opened and saved in an editor that added it.

There are various ways of removing a BOM, see e.g. here. Alternatively, re-dump the data.

Community
  • 1
  • 1
Pekka
  • 442,112
  • 142
  • 972
  • 1,088
  • Thanks, that led me in the right direction. Phpmyadmin has an option to download a gzipped sql dump, I used that and imported it instead. There must have been something in between my download and my upload adding that extra character... gzipping it ensured nothing was edited while transferring it (at least that's the best explanation that I can come up with as to why gzipping worked). – Troy Knapp Nov 10 '10 at 17:52