样本表:
CREATE TABLE test (name varchar(32)) ENGINE=InnoDB DEFAULT CHARSET=utf8;
INSERT INTO test VALUES ('adam');
INSERT INTO test VALUES ('ádam');
问题查询:
SELECT name FROM test WHERE username='ádam';
+----------+
| name |
+----------+
| adam |
| ádam |
+----------+
如何让MySQL搜索用户输入完全而不是隐式地将其音译为ASCII?
答案 0 :(得分:0)
mysql> SELECT name FROM test WHERE CONVERT(name USING BINARY) = 'ádam';
+-------+
| name |
+-------+
| ádam |
+-------+