Wednesday, July 30, 2008

How to Disable Table Name Case Sensitivity in MySQL

MySQL metadata is case sensitive by default on Linux. That is if you have a table my_table, in lower case, then
select * from my_table
will succeed while
select * from MY_TABLE
will fail with some sort of table doesn't exist message.

If you want both statements to succeed, you need to put the following line
lower_case_table_names = 1
in your /etc/my.cnf or wherever you keep your MySQL configuration. Be sure to add the system variable to [mysqld] section of the configuration file.

3 comments:

Gede said...

I already add on my.cnf
bunt it not work properly??
i already restart the service but something not happen

Gede said...
This comment has been removed by the author.
MariMuthu Rajagopal said...

really helped me.thanks very much.