Logo Background RSS

Modifying your MySQL databases to be UTF-8 compliant

  • Written by vinuvinu 1 Comment1 Comment Comments
    Last Updated: December 22nd, 2006

    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 ;

    Bookmark and share:
    • del.icio.us
    • Digg
    • StumbleUpon
    • BlinkList
    • blogmarks
    • Furl
    • Slashdot
    • Spurl
    • Technorati
    • YahooMyWeb
    • description
    • Facebook
    • Google
    • Live
    • Ma.gnolia
    • NewsVine
    • Reddit
    • TwitThis

Advertisement

  • Trackback: PHPDeveloper.org Trackbacks
  • Leave a Comment