Match '%' sign when searching in MySQL database
问题 I would like to match this 'wildcard %' in MySQL. I tried using escape \% and it is not working. 回答1: The default escape character is \ . So just prefix % with a \ as: \% : The manual clearly says: To test for literal instances of a wild-card character, precede it by the escape character. If you do not specify the ESCAPE character, “\” is assumed. Search for % in Stack%Overflow : mysql> select 'Stack%Overflow' like '%\%%'; +------------------------------+ | 'Stack%Overflow' like '%\%%' | +---