It is seldom considered that data storage requires explicit case of string type fields, and MySQL default queries are case-insensitive. But as user information, once the user name repeats, it will waste a lot of resources. Moreover, Li Kui, Li Ghost of more up, detective difficult to distinguish. To do this, either make the table explicit case-sensitive (the field is case-sensitive). If all the fields in the overall database need to be case sensitive, you might as well adjust the character set. However, this is not usually recommended.
If, like me, the database is already running online, millions data on a table, making a change in the field type can lead to a database outage. Well, in the query, add a word good!
For example, a general query:
SELECT * from ' user ' WHERE name is like ' a% '; SELECT * from ' user ' WHERE name is like ' A% ';
The result is the same, in order to differentiate between ' A% ' and ' A% ', you can do this:
SELECT * from ' user ' WHERE binary name is like ' a% '; SELECT * from ' user ' WHERE binary name is like ' A% ';
With just one binary, you can get a different result!
Of course, if you need to enforce a case-sensitive form, you can write:
Create table ' user ' ( name varchar) binary