How to change the default collation of a table?

前端 未结 4 1467
说谎
说谎 2020-11-30 16:21
create table check2(f1 varchar(20),f2 varchar(20));

creates a table with the default collation latin1_general_ci;

alte         


        
4条回答
  •  栀梦
    栀梦 (楼主)
    2020-11-30 16:46

    MySQL has 4 levels of collation: server, database, table, column. If you change the collation of the server, database or table, you don't change the setting for each column, but you change the default collations.

    E.g if you change the default collation of a database, each new table you create in that database will use that collation, and if you change the default collation of a table, each column you create in that table will get that collation.

提交回复
热议问题