How to transfer data from Database with latin1 character set, to database UTF-8. And on transferring convert data from latin1 to UTF-8 e.g., û->ū, ë->ė, þ->ž, á->į and etc.

  • Hope this link will help you
    – ravnur
    Dec 30 '11 at 10:31
  • Ok, i managed to output all data from latin1 database to file, using C:\Program Files\EasyPHP-\mysql\bin>mysqldump -uroot -p --default-charact er-set=latin1 9001_komeksimas pg_zodynas > c:\qqq.sql. Now the file is in ASCII encoding, but it has all the alphabet I need. So how to make a transfer to other db?
    – Minutis
    Dec 30 '11 at 11:33
  • You can use GUI client such as (Yog, Toad or smth else). Or you can run mysql -uroot -p < log_file.sql (dont forget to convert file to utf8)
    – ravnur
    Dec 30 '11 at 12:17
  • After transferring, the data remains with old wrong characters... Any more ideas? I dump file as mentioned above and then this is what i tried: 1)open dump with notepad++ change encoding to utf and run your query - same characters as before it was dumped. 2)just run your query without changing encoding. the same results.
    – Minutis
    Jan 3 '12 at 9:42

Found a solution. As I looked more into my first DB it had UTF-8 encoding, but all fields in tables was latin1. And data in there was windows-1257. So the solution:

SELECT CONVERT(CAST(pavad as BINARY) USING cp1257) pg_zodynas

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.