modnaut / primary

0 stars 0 forks source link

MySQL Case Sensitivity #51

Open bendalgaard opened 11 years ago

bendalgaard commented 11 years ago

We can control case sensitivity in MySQL, but there are some considerations/warnings. Here is the variable we are concerned with:

SHOW VARIABLES LIKE 'lower_case_table_names%'

We can set this variable to 2. This will preserve the case of table names/columns when they are stored on the file system, but querying will not be case sensitive. The only warning is if we move to a UNIX based system eventually.

_Use lower_case_table_names=0 on Unix and lower_case_tablenames=2 on Windows. This preserves the lettercase of database and table names. The disadvantage of this is that you must ensure that your statements always refer to your database and table names with the correct lettercase on Windows. If you transfer your statements to Unix, where lettercase is significant, they do not work if the lettercase is incorrect.

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