Encoding error with polish charset during transfer of database / server seting up

后端 未结 2 1194
谎友^
谎友^ 2021-01-27 16:43

I am trying to transfer one of my databases from one host (home.pl) to another (my newly set server). The script that I am trying to transfer is wordpress. Unluckily irrespectiv

2条回答
  •  佛祖请我去吃肉
    2021-01-27 17:12

    At the end I have founded out that the problem was related to the fact that the data was written to SQL incorrectly in my original server.

    I ended up with transferring DB using:

    mysqldump --default-character-set=utf8 [ORYGINAL_DB] | mysql [TARGET_DB] --default-character-set=utf8
    

    and the executing:

    UPDATE [table name] SET [field] = CONVERT(BINARY CONVERT([field] USING latin2) USING utf8)
    

    as it was advices here:

    strange character encoding of stored data , old script is showing them fine new one doesn't

    Hope that the above solution will be helpful for others too.

提交回复
热议问题