Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

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.

share|improve this question
    
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-5.3.8.1\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

1 Answer 1

up vote 1 down vote accepted

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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