0

I had to make change to my directory path in a lot of posts. I decided to export the DB and do a find/replace to makew the changes. But when I imported the DB back i got the error

1064 - You have an error in your SQL syntax;

which I think it becuase of mt charset not understanding them ampersand & amp;

How can I import this

2
  • Needs more info. What does the problematic line look like? What did you use to export and import the database? Are you sure you didn't break the file with the find/replace operations? Commented May 2, 2011 at 15:30
  • All in PHPMyAdmin. I exported the DB and in dreamweaver I did a find/replace to make my changes and imported it. I also imported the backup (what I exported, unchanged) and the error happened again. Commented May 2, 2011 at 16:33

2 Answers 2

1

It might help if you first change the file from utf-8 to iso-8859-1 with a command line program.

Start a command line session and change directory so you are in the directory that this file is in and enter the command

iconv -cs -f UTF-8 -t ISO-8859-1 utf8.txt > iso.txt

If you do not have access to a linux command line use google to find a windows method to convert between utf8 and iso character sets.

Sign up to request clarification or add additional context in comments.

1 Comment

I don't have any access to my DB other than phpmyadmin
0

You've not given much information in the question but I'd recommend the following approach:

  • Restore from your last backup
  • Have a look at MySQL's REPLACE() function. It should be able to do your find/replace work all in the database

2 Comments

was it generated by mysqldump? If you open the file in a text editor it should let you know in the first 10 or 20 lines.
think not. -- phpMyAdmin SQL Dump -- version 2.11.10 -- phpmyadmin.net -- -- Host: localhost -- Generation Time: May 02, 2011 at 10:21 AM -- Server version: 5.0.89 -- PHP Version: 5.2.12 SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO"; -- -- Database: mydb

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.