MySQL UTF-8无法识别特殊字符

时间:2019-12-02 06:41:19

标签: mysql utf-8 mysql-workbench

有人知道为什么会失败吗?

我已经创建了一个带有char3主键的utf-8表,并且在使用MySQL Workbench向其中插入记录时,它无法区分A和Ä

我们正在使用MySQL 5.1.73和Workbench 6.3.10

CREATE TABLE `test` (
  `citycode` char(3) NOT NULL,
    PRIMARY KEY (`citycode`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

INSERT INTO `test` (`citycode`) VALUES ('JLA');
INSERT INTO `test` (`citycode`) VALUES ('JLÄ');

Operation failed: There was an error while applying the SQL script to the database.
Executing:
INSERT INTO `trains4_copy`.`test` (`citycode`) VALUES ('JLA');
INSERT INTO `trains4_copy`.`test` (`citycode`) VALUES ('JLÄ');

ERROR 1062: 1062: Duplicate entry 'JLÄ' for key 'PRIMARY'
SQL Statement:
INSERT INTO `trains4_copy`.`test` (`citycode`) VALUES ('JLÄ')

1 个答案:

答案 0 :(得分:0)

请参阅此link,将这些类型的字符集存储为二进制。

var interval; // initialize at top

interval = setInterval(Down,myVar); // replace with this in `if(gameStarted)` loop

clearInterval(interval ) // clear interval on confirm("GAME OVER!")

尝试dbfiddle

相关问题