From: Dan Nelson Date: January 17 2012 4:23am Subject: Re: case insensitivity List-Archive: http://lists.mysql.com/mysql/226621 Message-Id: <20120117042318.GL91606@dan.emsphone.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii In the last episode (Jan 16), Haluk Karamete said: > How do I do case insensitive searches and replace operations? Is there an > easy way to do this? Like some sort of a server level setting telling > mySQL to ignore case for once and for all? For searches (i.e. comparisons in the WHERE clause), mysql should already be case-insensitive: mysql> show variables like 'collation%'; +----------------------+-------------------+ | Variable_name | Value | +----------------------+-------------------+ | collation_connection | latin1_swedish_ci | | collation_database | latin1_swedish_ci | | collation_server | latin1_swedish_ci | +----------------------+-------------------+ 3 rows in set (0.00 sec) The "ci" at the end means string comparisons are case-insensitive. If you're talking about the REPLACE() function, that is case-sensitive. You can always do REPLACE(LOWER(text),from,to), though, at the expense of having your result string lowercased on you. If you need to preserve case, try the stored function at http://forge.mysql.com/tools/tool.php?id=135 . -- Dan Nelson dnelson@stripped