MySQL Case sensitive and Case insensitive search with Match and Like

100

This post teaches you how to set your MySQL search queries to be Case sensitive or case insensitive.

It's all in the database collation. MySQL by default search case insensitive. In phpMyAdmin or or Putty change the Collation of your fields. Collations that are binary search case-sensitive. Collations that end with _ci like latin1_swedish_ci are case insensitive (ci is an acrynm for case insensitive.

To change your Collations quickly run this code in a loop:

ALTER TABLE tablename CONVERT TO CHARACTER SET latin1 COLLATE latin1_swedish_ci;

0 comments ↓

If you found this post useful click the share this button. Contribute below by adding a comment, no registration is required.


There are no comments yet...Kick things off by filling out the form below.

Leave a Comment