UNIQUE KEY constraint Mysql - a and Γ₯ are treated as the same characters

I have a unique key in a column. When I insert aand then Γ₯it gives an error message:

PHP Fatal error: thrown a "PDOException" exception with the message "SQLSTATE [23000]: integrity violation violation: 1062 Duplicate the entry" "for the key" restriction-1 "in ..

.... But aalso Γ₯- different UTF characters - so what happens ....?

Table

It has DEFAULT CHARSET=utf8mb4and utf8mb4_unicode_cicomparison.

+4
source share
1 answer

use unique collation in a unique column. latin1_swedish_ci

This is my server screen

Screen after selecting database

Screen after selecting table

Records in the table

Error while entering duplicate value

-4
source

Source: https://habr.com/ru/post/1598117/


All Articles