Table names case sensitivity question
Posted by: David Floyd (212.225.121.---)
Date: January 08, 2010 06:39PM

I am installing a mysql database (which is on a Linux server at the moment) on a Windows server, and it is converting all of the case sensitive tables to all lower case. The queries are case sensitive, so I need the tables to maintain their correct case table names.

Is there a way to configure the database to not alter the case sensitivity?

I believe there is after reading [dev.mysql.com] but I am not all that experienced in some of these matters.

Can anyone advise me how I change this system variable (in simple straightforward terms, please)

Thanks,
(Using MySQL 5.0)

Options: ReplyQuote
Re: Table names case sensitivity question
Posted by: stevenmartin99 (---.b-ras2.blp.dublin.eircom.net)
Date: January 08, 2010 06:54PM

add this line

lower_case_table_names=2

to your my.ini file and restart wamp


you cannot remove this tho or it will stop working

Steven Martin
stevenmartin99@gmail.com
stevenmartin99@hotmail.com
PampServer.com - [pampserver.com]



Edited 1 time(s). Last edit at 01/08/2010 07:20PM by stevenmartin99.

Options: ReplyQuote
Re: Table names case sensitivity question
Posted by: c2dan (---.15-1.cable.virginmedia.com)
Date: January 08, 2010 07:08PM

By default on Windows, MySQL will change database/table/column names to lowercase.

It is recommend to keep all database/table/column names in lowercase format.

Options: ReplyQuote
Re: Table names case sensitivity question
Posted by: David Floyd (212.225.121.---)
Date: January 08, 2010 07:19PM

Thanks for replying.

I don't know what you mean by 'normally'!

I created a table in phpMyAdmin.

Just for example I created table 'Temp' but it appears as 'temp'

The SQL is:
CREATE TABLE `mydb`.`Temp` (
`Temp` INT( 11 ) NOT NULL
) ENGINE = InnoDB;

The result of this is that the Table is 'temp' and the Field is 'Temp'

David

Options: ReplyQuote
Re: Table names case sensitivity question
Posted by: stevenmartin99 (---.b-ras2.blp.dublin.eircom.net)
Date: January 08, 2010 07:21PM

add this line

lower_case_table_names=2

to your my.ini file and restart wamp


you cannot remove this tho or it will stop working

Steven Martin
stevenmartin99@gmail.com
stevenmartin99@hotmail.com
PampServer.com - [pampserver.com]

Options: ReplyQuote
Re: Table names case sensitivity question
Posted by: David Floyd (212.225.121.---)
Date: January 08, 2010 07:23PM

In reply to c2dan, I am aware of that, but I already have an extensive database driven web-site on Linux and it would be a mammoth task to re-write all the queries.

If you refer to may original post, there would appear to be a way to change the Server Settings, but I cannot figure out how to do this. - That was my query.

David

Options: ReplyQuote
Re: Table names case sensitivity question
Posted by: David Floyd (212.225.121.---)
Date: January 08, 2010 07:33PM

To Steven Martin,

I've just seen your second reply which I will try, Thanks.

Got to go out now, so will do it later this evening.

David

Options: ReplyQuote
Re: Table names case sensitivity question
Posted by: c2dan (---.15-1.cable.virginmedia.com)
Date: January 08, 2010 09:09PM

David Floyd Wrote:
-------------------------------------------------------
> In reply to c2dan, I am aware of that, but I
> already have an extensive database driven web-site
> on Linux and it would be a mammoth task to
> re-write all the queries.

You wouldn't need to rewrite the queries. MySQL will automatically convert the table/column names used in the query to lowercase.

Options: ReplyQuote
Re: Table names case sensitivity question
Posted by: David Floyd (212.225.121.---)
Date: January 09, 2010 12:16AM

stevenmartin99 Wrote:
-------------------------------------------------------
> add this line
>
> lower_case_table_names=2
>
> to your my.ini file and restart wamp
>
>
> you cannot remove this tho or it will stop working


Thanks for this. That was exactly what I was looking for.

Thanks for your help

David

Options: ReplyQuote
Re: Table names case sensitivity question
Posted by: David Floyd (212.225.121.---)
Date: January 09, 2010 12:19AM

c2dan Wrote:
-------------------------------------------------------
> David Floyd Wrote:
> --------------------------------------------------
> -----
> > In reply to c2dan, I am aware of that, but I
> > already have an extensive database driven
> web-site
> > on Linux and it would be a mammoth task to
> > re-write all the queries.
>
> You wouldn't need to rewrite the queries. MySQL
> will automatically convert the table/column names
> used in the query to lowercase.

Thanks for your help, but that doesn't suit how we maintain our web site hosted on a Linux server. One of us needs it locally on a Linux server and another needs it locally on a WAMP server.

I now have the solution, thanks.

David

Options: ReplyQuote
Re: Table names case sensitivity question
Posted by: yfastud (Moderator)
Date: January 09, 2010 04:27AM

by default, *nix always case sensitive while win is not, so you might have to twist it a little bit to suit your needs and glad you've found a solution winking smiley

Have fun,

FREE One A Day
FREE Photo
FREE Games
FREE Websites
FREE Portable GPS
FREE WAMP Guides

Options: ReplyQuote


Sorry, only registered users may post in this forum.