How do I change a MySQL table to UTF-8?

前端 未结 5 513
野趣味
野趣味 2020-12-15 03:57

I know there are many settings for a language for a table and a database.

I already created the database. I believe when I created it, it was default/LATIN. I want

5条回答
  •  -上瘾入骨i
    2020-12-15 04:50

    Have a look at Using alter command to change character set.

    Another useful link: http://dev.mysql.com/doc/refman/5.0/en/charset-table.html

    The general form is

    ALTER DATABASE db_name
        [[DEFAULT] CHARACTER SET charset_name]
        [[DEFAULT] COLLATE collation_name]
    

    and for a specific column in a table

    ALTER TABLE column COLLATE utf8_general_ci
    

    • MySQL’s character sets and collations demystified
    • MySQL Forums :: Change Collation

提交回复
热议问题