Convert MySQL table to utf8

Read here how to change all your DB to utf8, pretty simple, but you gotta know it. Even when your app runs in latin1 only, it reduces a couple problems in case you forgot some check and utf8 is slipping through. I will let you know if I can prove that right. But since Django is trying to be unicode compliant, it’s easier to use it than to work around it.
It does at least already eliminate the problem of getting this error:

Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE)

this was discussed here.
In short:

ALTER TABLE tbl_name CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;

30 Comments »

  1. Mike said,

    February 28, 2009 at 4:21 am

    Thanks for posting this!

    I change this so seldom that by the time I need to do it again I’ve forgotten how!

  2. MySQL + UTF-8 = Not So Obvious « Ward’s Words said,

    March 28, 2009 at 9:56 am

    [...] existing literature on the topic including possible fixes [here, here, here, here, here, here, horror story here, here] encourage the configuration of the MySQL daemon [...]

  3. Carolina said,

    August 20, 2009 at 10:40 am

    Hello,
    I have a question. This command that was written by Wolfram only modifies the charset from the table… But not all string datatypes from the table. Those remained without been changed… Is there a way to alter the table recursively, so that all string datatypes from the table will be also modified to utf8?

    Thank you very much!

  4. online stock trading guru said,

    January 11, 2010 at 5:39 am

    Super-Duper site! I am loving it!! Will come back again - taking your feeds too now, Thanks.

    I’m Out! :)

  5. Normaderm said,

    January 20, 2010 at 10:54 am

    thank ^ ^

  6. Mobiel Abonnement said,

    May 25, 2010 at 11:03 am

    Thank :) it helpt me to convert my database

  7. Ali KILIC said,

    November 28, 2010 at 3:24 pm

    thank you so much ))) easy and fast

  8. Passief inkomen said,

    February 11, 2011 at 10:03 pm

    Just what I needed. This code converted my MySql database easy to UTF8, quick and dirty fix, highly recommended. Thanks from Holland!

  9. Air Jordan 19 Retro said,

    May 14, 2011 at 9:46 am

    I commend the illuminating article you provide in your articles. I’ll bookmark your blog and play a joke on my friends explore up in your blog frequently.

  10. stickers murali said,

    June 15, 2011 at 10:15 am

    thanks for the share. I was just having troubles parsing gTranslate’s output while I figured out my Database uses a damn cp_1251 encoding causing some characters to be saved as questionmarks.
    Thanks.

  11. Jordan Retro Sneakers said,

    July 7, 2011 at 8:35 am

    The Air Jordan 13 Retro Flint French Blue University Blue Flint Grey colorway is one of many Air Jordan XIII Retro’s to be released on March 19th, 2005. Compared with the original colorway, the Air Jordan 13 Retro Flint is definitely nothing new, but very fitting for the sleek curves of the Air Jordan XIII.Some images of the Air Jordan 13 Retro Flint are out here.

  12. RayBan Sunglasses said,

    July 27, 2011 at 4:24 am

    the Air Jordan 13 Retro Flint is definitely nothing new, but very fitting for the sleek curves of the Air Jordan XIII.Some images of the Air Jordan 13 Retro Flint are out here.

  13. franklin marshall hoodies said,

    July 27, 2011 at 4:25 am

    franklin marshall hoodies sale for cheap

  14. Nike Soccer Shoes said,

    July 27, 2011 at 4:26 am

    This code converted my MySql database easy to UTF8, quick and dirty fix, highly recommended. Thanks from Holland!

  15. adidas climacool ride said,

    July 27, 2011 at 4:27 am

    adidas climacool ride sale fpr cheap

  16. cheap onitsuka tiger said,

    August 27, 2011 at 9:59 am

    limacool ride sale fpr cheap

  17. d3nnnis said,

    September 8, 2011 at 12:47 pm

    Nice article :) Really recommend this to anyone. I’ve just done this and it’s really easy :)

  18. watch football live said,

    September 25, 2011 at 11:50 pm

    great submit, very informative. I’m wondering why the other experts of this sector don’t realize this. You must continue your writing. I’m sure, you have a great readers’ base already!

  19. live nfl football said,

    October 1, 2011 at 2:47 pm

    An impressive share, I simply given this onto a colleague who was doing just a little analysis on this. And he in fact bought me breakfast because I discovered it for him.. smile. So let me reword that: Thnx for the treat! But yeah Thnkx for spending the time to discuss this, I really feel strongly about it and love reading more on this topic. If attainable, as you grow to be experience, would you thoughts updating your weblog with extra details? It’s highly useful for me. Large thumb up for this weblog publish!

  20. HTCHD7 CArriers said,

    October 24, 2011 at 1:13 am

    It’s hard to find knowledgeable individuals on this topic even so you sound like you know what you are talking about! Thanks

  21. free cell phone tracker said,

    October 29, 2011 at 3:07 am

    You got a very very good web site, Gladiolus I identified it by means of yahoo.

  22. Franklin Marshall Sweatshirt said,

    November 17, 2011 at 5:12 am

    Layer up in this Franklin Marshall Sweatshirt by Henri Lloyd, created in a soft cotton sweat. The perfect layered over a Lyle and Scott checked shirt or Paul Smith jersey top, this sweatshirt features a half snap button opening with branded white buttons and large front kangroo pocket. Finished with gently ribbed cuffs and hem and trademark Henri Lloyd to the left arm

  23. Franklin Marshall Sweatshirt said,

    November 17, 2011 at 5:12 am

    The Franklin Marshall Sweatshirt Open or closed; hood up or hood down. No matter how you wear it, you’ll look great in this heavyweight zip-up hoodie. Made from a 283g fleece (80/20 cotton/poly) with a double fleece-lined hood. Has 1×1 ribbing, nickel eyelets and zipper, and split stitch double-needle sewing on all seams

  24. Cierra Coltey said,

    December 4, 2011 at 8:06 am

    Some genuinely prime posts on this website, saved to bookmarks.

  25. ways to save money said,

    December 4, 2011 at 10:15 am

    One of many best shopping on the web websites, Amazon online always holds the first position featuring its greatest gives along with superior technology stated in utilize to create existence simpler as well as simple.

  26. asdfgt29j said,

    December 25, 2011 at 1:08 am

    the model turned actress Sayali Bhagat single row ralph lauren polo w becomes the cake when existence.ralph Lauren and this is also true of specialized existence, your woman the confidence to actively play different roles. “I see in me adaptive occasional actress. I have brought major films, and even humor, moving images and glamorous perform, Polo Ralph Lauren approval so on. I really have often wished to complete ralph lauren sale ralph lauren sale b a new work and also act” Sayali explained by ralph lauren uk ralph lauren uk g the meeting. Sayali produce movies like “train”, “prison”, “company Bol” along with “paying guest”, preferring to engage in passionate. “I really want to reduce the serious conduct, Ralph Lauren achieving your easygoing passionate films, most need to do is actually bodes well, dancing, dressing in fine clothes. In the IM to perform, mainly ralph lauren uk k because these concerns point increase calendar year by 12 months, “a special 27-year-old celebrity mentioned. And even ralph lauren sale q an old miss India, Polo Ralph Lauren will be in the near future appears around horror-thriller “Ghost”, the special wish for soon after working with stone dust, sweat. “I really want to use crushed limestone perspiration.Ralph Lauren Polo Immediately after every actor wants to achieve not less than affectionate moving pictures and your ex boyfriend inside your own lifestyle,” said had last welcomed Sayali as “naughty @ 30.” For Jatinder Bedi), Ralph Lauren femme the special “Ghost”, and introduced at 12, of sixteen actor shiney Ahuja.

  27. asdfgt22t said,

    December 29, 2011 at 11:35 am

    the importance of clothing can not be ignored in today’s fast life in motion. How they are physically present, has a significant impact on how a man agrees to some extent but not completely. There are a lot of importance attached abercrombie fitch sale abercrombie fitch sale u to this kind of clothes we wear in our daily lives. Then the clothing companies such as Abercrombie Fitch Abercrombie Fitch go to more than 100 years. It was founded in 1892 and has been producing clothes for men, women and children. Abercrombie is one of the leading brands in casual wear. He specializes in the collection abercrombie fitch sale c of men’s shorts Abercrombie shirts Abercrombie, Abercrombie t-shirts, Abercrombie Polo, etc.

  28. Cheap Ryan Grant Authentic Jersey said,

    January 4, 2012 at 3:42 pm

    Thank you for the good writeup. It the truth is was a amusement account it. Look advanced to much more added agreeable from you! Even so, how could we communicate?

  29. Hedy Cotroneo said,

    January 14, 2012 at 6:00 pm

    My name is Lorenzo Lynch. Could u add a backlink on this page? You can reach me at MilesFranklin6881@gmail.com or ICQ:136086145

  30. Branda Artinger said,

    January 16, 2012 at 8:08 am

    A pity, but I debate with this unique upload. I do like your specific wordpress blog though and will keep on moving once again for news.

RSS feed for comments on this post · TrackBack URL

Leave a Comment