VT's Blog

Everything which goes around me 24×7

  • General Stuff
  • Linux
  • Programming Programming Stuff
    • Ajax
    • Cloud Computing
    • CSS
    • Databases
    • HTML5
    • Interoperability
    • Javascript
    • PHP
    • Security
    • Techniques
    • Web Development
  • Services
  • Sites Useful Sites
  • Software
    • Games
    • Scripts
    • Symbian

Stay Updated: Posts | Comments

  • Home
  • About
  • Archives
  • Sitemap
« Fluent Interfaces in PHP
Merry Christmas and Happy Holidays »
  • Modifying your MySQL databases to be UTF-8 compliant

    Databases
    22nd December 2006 - By Vinu Thomas

    Most of us have had problems with UTF-8 problems in PHP and MySQL. Here’s how to modify your database and table to be UTF-8 compliant. Most of the time we do set the character set to utf8 but forget to set the collation set to utf8.

    Use the following MySQL statements to convert your database and tables:

    ALTER DATABASE mydatabase
    CHARACTER SET utf8
    DEFAULT CHARACTER SET utf8
    COLLATE utf8_general_ci
    DEFAULT COLLATE utf8_general_ci ;


    ALTER TABLE mytable
    DEFAULT CHARACTER SET utf8
    COLLATE utf8_general_ci ;

  • 2 Comments to “Modifying your MySQL databases to be UTF-8 compliant”

    • PHPDeveloper.org on December 28, 2006

      Vinu Thomas’ Blog: Modifying your MySQL databases to be UTF-8 compliant…

      …

    • Zend_Db: utf8 query string gets inserted as non-utf8 « Willing wheels on June 28, 2009

      [...] http://blogs.vinuthomas.com/2006/12/22/modifying-your-mysql-databases-to-be-utf-8-compliant/ [...]

    Leave a Reply

    Click here to cancel reply.


Copyright © - VT's Blog

 

  • About the Author

    Vinu Thomas

    Vinu Thomas is the editor of My Portable World and VT's Tech Blog. As a Technical Architect, he works on PHP and opensource technologies by day and is a mobile enthusiast and blogger. You can follow him on Twitter @vinuthomas and Google+

  • Syndicate

    RSS feed

    Subscribe to this site's RSS feed.

    Desktop Reader Bloglines Google Live Netvibes Yahoo!
  • Subscribe by Email

    If you're not into RSS feeds, and want to get the latest posts be email, fill in this form, and Google will send you an email everytime a new post is up
    Enter your email address:
  • Sponsors