Case Sensitivity in MySQL Collation
MySQL offers a variety of collation types, but determining which one supports case sensitivity can be confusing. This question delves into the availability of case-sensitive collations in MySQL and provides detailed answers.
Answer 1:
According to the MySQL Manual, setting the collation to "_cs" enables case sensitivity. You can view the available _cs collations using the query "SHOW COLLATION WHERE COLLATION LIKE "%_cs"".
Answer 2:
However, further research reveals that there are no utf8_*_cs collations in MySQL. For case-sensitive utf8 fields, "utf8_bin" should be used. While this may disrupt ordering, it can be resolved by using "ORDER BY column COLLATE utf8_general_ci".
Additional Resources:
The above is the detailed content of Does MySQL Offer Case-Sensitive Collations, and How Can I Use Them?. For more information, please follow other related articles on the PHP Chinese website!