MYSQL SELECT WHERE LIKE WITH AES_ENCRYPT
问题 How would I perform a Mysql SELECT with WHERE and LIKE serach if field is AES_ENCYPTED? Example: SELECT AES_DECRYPT(place,'"+salt+"'),AES_DECRYPT(web_address,'"+salt+"') FROM access WHERE place= LIKE '%(AES_ENCRYPT('"+searchStr+"','"+salt+"'))',%') Basically, perform a search on an encrypted column with the LIKE wildcard on both ends of the $searchStr 回答1: You can't search on an encrypted column without first decrypting it. You'll need to do WHERE AES_DECRYPT(like, salt) LIKE '%something%'