View Full Version : MySQL turns to lowercase

08-04-2006, 09:02 PM
I am seriously being bugged about the idea that everytime I make a query like:

creates a database mydatabase

I need it to be the exact case: eg MyDatabase must be MyDatabase and mydatabase be mydatabase

is this a bug or is MySQL actually worse than Access?

Please Help, I can't make databases with lowercase... or uppercase.. I need mixed case

Thanks :S

08-04-2006, 09:05 PM
why do you care about case?
whenever you interact with the database it will sort itself out...

08-04-2006, 09:09 PM
True but there are 3 reasons.

1) It is harder to recognize the database I need, I use a lot of spacing and Casing thus it helps a lot

2) One person who wanted a database from me took me extra time to go to the mysql server root, and edit the names of all the object... It is annoying

3) It is really annoying when something doesnt do what it is suppose to and I can't do anything about it, especially when I know enough SQL

Kid Charming
08-04-2006, 10:15 PM
The lower_case_table_names system variable determines this behavior, but you should read this (http://dev.mysql.com/doc/refman/5.1/en/name-case-sensitivity.html) before changing it.

08-05-2006, 01:50 AM
where is the ini file with that option located?

Kid Charming
08-05-2006, 06:25 AM
It depends. Linky (http://dev.mysql.com/doc/refman/5.1/en/program-options.html).

08-05-2006, 08:26 PM
I am using Windows XP how am I suppose to add case sensetivity that is all I ask, I dont use command prompt for mysql... plus it doesnt work from the way above :(

sorry but... I guess i will quit mysql, I'll go get oracle... I think

08-05-2006, 11:58 PM
You can't get case sensitivity in Windows since that isn't offered by that operating system, that was in the first link given to you.

I personally think it is a waste of time worrying about whether or not you can mix case for naming conventions. The data is what is important, not the box that it is held in.

08-06-2006, 07:10 PM
yes but it is extremely uncomfortable and not tidy at all

i always use mixed case like

Name or

but name and lastname woundnt help, why is it made in this way?

08-06-2006, 10:41 PM
why is it made in this way?Because Bill Gates doesn't believe that case sensitivity is important in his OS.

08-07-2006, 02:05 AM
I mean both my Database name and Table names in mysql turn lowercase while my records are case-sensetive

Is there a way or not, if not is there a real Database that can be case sensetive or is SQL, MySQL, Oracle, DB1/2/3(if exists)

because I seriously got used to case sensetivity, especially while using PHP, C#, C++, Javascript, XHTML and such :(

08-07-2006, 03:53 AM
Are you not reading or what? MySQL is case sensitive if you were to use a brand of UNIX. MySQL is not case sensitive when you use windows since Windows does not support case sensitivity.

because I seriously got used to case sensetivity, especially while using PHP, C#, C++, Javascript, XHTML and such

that may be true but that would be because the editors you are using support case sensitivity. But I bet you can't save any of those files in mixed case for the file name on Windows now can you?

08-07-2006, 04:24 AM
to tell you the truth I can...

attempt: save as: MyFiLeName.php
result: MyFiLeName.php

I make programs with mixed case all the time like: WebBrowser(test) or TeXtEd

sorry but I think this is what you asked... and no I will never in my life use anything but Windows and Mac... Mac looks nice(OS X)... even though I never touched a mac in my whole life ... same for Linux, and UNIX, and other OS

Kid Charming
08-07-2006, 05:59 AM
Yes, you can save MyFileName.php. Then you can refer to (or overwrite) it with myfilename.php, MYFILENAME.php, MyFileNAME.php, etc.

The best you're going to get is to set your lower_case_table_names variable to 2, which will mirror Windows behavior of displaying with case, but storing without it. The second link I posted will tell you what options you have for setting that variable, including using an options file.

08-07-2006, 03:01 PM
KidCharming, thanks for clarifying my point. Damn, I hate when I know what I'm talking about but then say something entirely different. My wife tells me I do that all the time. :eek:

08-07-2006, 08:29 PM
I checked the tuts for doing it but... this is my.ini

Server=C:/Documents and Settings/dima/Desktop/xampp/mysql/bin/mysqld-nt.exe

and on my Win98 it has a lot of things in it but no lower_case_table_names feature... :(

Kid Charming
08-07-2006, 09:22 PM
You need to add it. The variables have default values that the server initializes to automatically. It doesn't need to refer to an options file to determine what those defaults are, and those files don't need to list the variable unless you want it to be initialized to something other than the server's default. Find the line '[mysqld]' and put 'lower-case-table-names=2' somewhere beneath it.

08-07-2006, 09:29 PM
This is such a bizarre thing to get hung up on. I understand the whole "I am accustomed to a certain thing", but there is such thing as adaptability, too.

In the mainframe world I am from, it was all caps, all the time, using dashes like


But so what? When I certified Java I learned that the norm is to stick words together and capitalize the first letter of each word (except the first one actually).


The shop I learned DB2 in there were strict naming standards for tables and columns.

CUSTOMER_NM (column)

So now I learn MySQL, and it happens to not care about case, so I adapt yet again:


In 10 years it will probaby be something else entirely yet again, and we'll have to adapt yet again :) Just roll with it... you'll be able to tell stories to your grandkids about how MySQL didn't care about case and you had to change the way you named things. Good entertainment!

08-07-2006, 09:42 PM
Just roll with it... you'll be able to tell stories to your grandkids about how MySQL didn't care about case and you had to change the way you named things.
it's microsoft that doesn't care --> no need to lie to those innocent children.
DELOCH, I suppose this then is at least one reason why not to like microsoft...

08-07-2006, 10:29 PM
True but one more thing...

When I rename the table mytable to MyTable, in editor I see MyTable not mytable... so it does display replica of the original table name not lowercase version

Kid Charming
08-07-2006, 10:54 PM
Erm...yeah. It reads directly from the filesystem -- if you've manually added case to those filenames after table creation, that's how you'll see them. The lower_case_table_names variable determines how the identifier is stored upon creation and how it is looked up internally.

08-19-2006, 01:18 PM
Just to add my pennyworth!

I think Deloch is right in worring about case.
What would happen if the server were to be moved onto a Unix platform.

The data would now be in a different box.
And it woulld be worthless.


08-25-2006, 01:02 PM
there no point in making so much fuss out of this: you just adopt the naming rule to always use lowercase for tablenames and you get on with your life...