开发者

MySQL error 1064 when importing Wordpress DB in PHPMyAdmin

开发者 https://www.devze.com 2023-03-02 12:04 出处:网络
I had to make change to my directory path in a lot of posts. I decided to exp开发者_如何学JAVAort the DB and do a find/replace to makew the changes. But when I imported the DB back i got the error

I had to make change to my directory path in a lot of posts. I decided to exp开发者_如何学JAVAort 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


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.


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
0

精彩评论

暂无评论...
验证码 换一张
取 消