Mysql string matching requirement table data: Java code mysql> select * from test; + ---- + ------- + | id | name | + ---- + ------- + | 1 | abc ** | + ---- + ------- + 1 row in set (0.00 sec) I want to match abcde, that is, a * represents a Character Analysis: * represents 0 or more in the regular expression. Therefore, if there is a storage problem, it should be stored. alternatively, you can use like and REGEXP to query SQL statements. Conclusion: 1. use the likeJava code mysql> select * from test where 'abcde' like replace (name ,'*','_'); + ---- + ------- + | id | name | + ---- + ------- + | 1 | abc ** | + ---- + ------- + 1 row in set (0.01 sec) replace it with _ and then match 2 in like. use REGEXPJava code mysql> select * from test where 'abcde' regexp replace (name ,'*','. '); + ---- + ------- + | id | name | + ---- + ------- + | 1 | abc ** | + ---- + ------- + 1 row in set (0.02 sec) replace. then