Search code examples
phpmysqlhtmlencodingems

Import Chinese characters in MySQL


Possible Duplicate:
Import chinese character in mysql table.

How can I import an Excel file with Chinese characters into a MySQL table (EMS Manager). Can anyone please help me? Thanks.


Solution

  • by default connection is not UTF-8 enabled in many installs, try this in my.cnf:

    [client]
    default-character-set = utf8
    
    [mysqld]
    collation_server=utf8_unicode_ci
    character_set_server=utf8
    skip-character-set-client-handshake
    default-character-set = utf8
    default-collation = utf8_general_ci
    

    There is also a SQL way to do it in connection if above cannot be set:

    SET NAMES UTF8