0

Statement 1

INSERT INTO `abc`.`a` (`name`) VALUES ('Otp1');

Statement 2

 INSERT INTO `abc`.`a` (`name`) VALUES ('Ötp1');

I have unique constraint on column name.

Statement 2 throwing following exception.

Error Code: 1062. Duplicate entry 'otp1' for key 'name' 0.000 sec

I tried to configure database with following settings,

  1. Collation = utf8 - Defalut collation
  2. Collation = utf8_swedish_ci

But, SQL is not able to differentiate between o and Ö due to that it is throwing exception.

Can anyone assist me how to resolve this issue.

4

1 回答 1

1

utf8_swedish_ci通过将以下数据库属性更改为from解决了问题utf8_general_ci

  1. collat​​ion_connection,
  2. collat​​ion_database,
  3. collat​​ion_server 属性
于 2018-07-16T15:31:31.523 回答