MySQL select by password() does not return expected result
问题 In MySQL I execute insert into test (id, pw) values(1, password('1234')); I got Query OK, 1 row affected, 1 warning (0.01 sec) I want to search a record by password, so I execute select * from test where pw = password('1234'); I expect it to return one row, but I get an empty set. What did I do wrong? 回答1: The MySQL Password() function generates a nonbinary string currently (circa 2016) up to 41 characters. This is visible thru either calls to SHOW CREATE TABLE mysql.user; and examining the