How to make MySQL colum name case insensitive in Cent OS?


Problem :

I am using Cent OS 6.5 and MySQL 5.1.73 and I know database name and table name and also column names are case sensitive in Cent os

Now, I want to make MySQL work as case insensitive in Cent OS.

I have tried the below link its worked for the table name. But i need to case sensitive for the table-column names

How to force case sensitive table names?

Is it possible? If yes, how can I do it?



Solution :

It depends from the type of the table you create. For strings (CHAR, VARCHAR, TEXT), string searches use the collation of the comparison operands.

http://dev.mysql.com/doc/refman/5.7/en/case-sensitivity.html

for exemple if the table collation is utf8_general_ci the _CI indicates case insensitive

else the collation utf8_general is case sensitive

you can easily change the collation of your table with an update.

example of a CASE INSENSITIVE TABLE (utf8_general_ci)

CREATE TABLE  `test` (
`id` VARCHAR( 32 ) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL ,
`value1` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL
) ENGINE = MYISAM CHARACTER SET utf8 COLLATE utf8_general_ci

example of a CASE SENSITIVE TABLE (utf8_general)

CREATE TABLE  `test` (
`id` VARCHAR( 32 ) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL ,
`value1` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_general NOT NULL
) ENGINE = MYISAM CHARACTER SET utf8 COLLATE utf8_general

Also if you want you can change the default collaction as explained here https://dev.mysql.com/doc/refman/5.7/en/charset-syntax.html

There are default settings for character sets and collations at four levels: server, database, table, and column.


Mysql Tutorials

Mysql Howto..

How can I copy one column (field) from one table to an empty column (field) of another table both of which are part of same database using MySQL?

How to link sent and received messages in mysql?

How to convert an xls file to mysql format?

How do I routinely kill MySQL queries that have been alive for “too long”?

How to get rows with array of ids in MySQL

How to make value in ascending order in the mysql?

How to copy a mysql table to another in cakephp?

how to retrieve woocommerce product details based on their category_id using mysql -php

How do I convert MySQL unsigned ints to Protocol Buffer uint32s in Java?

How to get count for each result in this MySQL query?

How do I write SQL to get objects

How to host a developed web application? [closed]

how to load data from local file in php with pdo driver

mysql - How to determine the length of a field which stores a mutable string?

how to get the table of missing rows in mysql

How to check if id exists in another table given table is 30 million records?

How to get rows older than 30 min

How to test across multiple mysql schemas with PHPUnit?

How to substract time in mysql and display in PHP

How to let data “disappear” from database? MySQL

how to do auto increment?

How to select a row for certain (or give preference in the selection) in mysql?

MySQLMembershipProvider and MySQLRoleProvider not showing in ASP.NET Web Site Administration Tool

How to display MySQL content in an HTML table with PHP [closed]

How could I create two levels of authentication for registration on my site?

How mysql works with processes?

How to render white space and paragraphs in varables when storage in MySQL?

How to store AES encrypted password in MySQL database

How do I go about implementing time management for auction website?

How would I count MYSQL rows down to a specific row in PHP?