When searching for partial strings in MySQL with LIKE you will match case-insensitive by default*.
SELECT name FROM users WHERE name LIKE 't%'
+--------------------+
| name |
+--------------------+
| Test |
| test |
+--------------------+
If you want to match case-sensitive, you can cast the value as binary and then do a byte-by-byte comparision vs. a character-by-character comparision. The only thing you need to add to your query is BINARY.
SELECT name FROM users WHERE name LIKE BINARY 't%'
+--------------------+
| name |
+--------------------+
| test |
+--------------------+
* Assuming default character set and collation. The primary factor in determining case-sensitivity in this case is the collation of the column being searched (see Case Sensitivity in String Searches). (Thanks Nick N.)
✉️ Have a comment? Please send me an email.