Skip to content

Categories:

MySql Migration Toolkit MSSQL latin1 to MySql utf8

We’ve all been there.
The dreaded Umlaute and special characters have been turned into minced words by some character encoding incompatibility.

When converting a database from MSSQL(2000) to MYSQL (v5) I must have spent days trying to figure this problem out. Some people have come up with very creative albeit complicated solutions:
http://www.oreillynet.com/onlamp/blog/2006/01/turning_mysql_data_in_latin1_t.html

Instead, I found this:
http://forums.mysql.com/read.php?104,124017,124790#msg-124790
Thank you Miguel.
The solution is simple:

In Migration Toolkit’s first step, where you select the source and target db, in Advanced >> option, use the following jdbc connection string for MSSQL:
jdbc:jtds:sqlserver://server:1433/database;user=user;password=password;useUnicode=true;domain=

And this one for MySQL:
jdbc:mysql://server:3306/?user=user&password=password&useServerPrepStmts=false&useUnicode=true

Forget the utf-8 character encoding that you see elsewhere. useUnicode rules. And so does Miguel.

Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks

Posted in code. Tagged with , , .

7 Responses

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.

  1. Igor said

    Excelent you save my life!

  2. Wow, Thank you!! I just spent 6 hours going through this also. I was headed down very wrong approaches. Getting the data right during the conversion is much easier than trying to fix it after-wards.

  3. Gerben Dijkstra said

    You deserve a congressional medal of honor dude, saved us tons of time, thanx a lot :)

  4. admin said

    thanks Gerben!

  5. admin said

    Yes, I found the same thing after trying to correct the data after the conversion.

  6. Derek said

    YOU ROCK!

    JUST SAVED ME DAYS!

Continuing the Discussion

  1. Data Migration from SQL Server to MySQL « Almost All Digital linked to this post on October 21, 2011

    [...] Use it to pull data from SQL Server to local MySQL server.Doesn’t seem to do character conversion correctly, even when you specify “useUnicode” in JDBC connection strings a la this article here. [...]

Some HTML is OK

(required)

(required, but never shared)

or, reply to this post via trackback.