MySQL distinction between e and é (e acute) - UNIQUE index

前端 未结 4 519
挽巷
挽巷 2020-12-01 09:32

I have a table, students, with 3 columns: id, name, and age. I have a UNIQUE index Index_2 on

4条回答
  •  情歌与酒
    2020-12-01 10:29

    I found that

    ALTER TABLE students CHARACTER SET utf8 COLLATE utf8_bin;
    

    did not work for me, as it didn't change the collation of existing columns, as can be seen in the results of this query:

    SHOW FULL COLUMNS from students;
    

    However, the following query did the job and converted existing columns to utf8_bin collation:

    ALTER TABLE students CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
    

    (notice the "CONVERT TO")

提交回复
热议问题