In MySQL, the string space in the query condition is assumed that there is a table in the current mysql database: sysuser has a field: The sysUseName field contains a record: here are the two SQL statements: www.2cto.com SELECT * from sysuser s where s. sysUseName = 'Robin 'SELECT * from sysuser s where s. sysUseName = 'Robin space' SELECT * from sysuser s where s. the three statements sysUseName = 'Robin space' can query the record. The official document says that the MySQL checking rule belongs to PADSPACE. Comparing CHAR and VARCHAR values ignores trailing spaces, and does not matter with server configuration or MySQL version. MySQL installation directory has a doc directory (Windows ), the section "Data Types-> String Types-> The CHAR and VARCHAR Types" in The section describes The problem and related examples. (If The version is different, The chapter numbers may change, see the title): All MySQL collations are of type PADSPACE. this means that all CHAR and VARCHAR values in MySQL are compared without regard to any trailing spaces. the question is: how do I need to precisely match the content of robin? Suppose there is a login function. I want the user to enter 'Robin 'to log on, but enter 'Robin space' but cannot log on. How can this problem be achieved. Solution: SELECT * from sysuser s where s. sysUseName = BINARY 'Robin 'BINARY is not a function and is a type conversion operator. It is used to force the string following it to be a BINARY string. It can be understood as case sensitive during string comparison, exact match. In addition, because some MySQL, especially 4. * used to have inaccurate Chinese search results, binary can be added during the search.