MySQL table names forced to lower-case, and table_exists function case-sensitive ? |
[eluser]aidehua[/eluser]
Wow, this gets fiddly. I'm sure I'm not the only person out there who is developing on Windows for eventual deployment to Linux, and who has a fondness for CamelCasing table names. So here's what I've found: Read this page to find out about the lower_case_table_names system variable. The default value of lower_case_table_names on Windows is 1: "Table names are stored in lowercase on disk and name comparisons are not case sensitive. MySQL converts all table names to lowercase on storage and lookup. This behavior also applies to database names and table aliases." Quote:If you are using MySQL on only one platform, you do not normally have to change the lower_case_table_names variable from its default value. However, you may encounter difficulties if you want to transfer tables between platforms that differ in file system case sensitivity. For example, on Unix, you can have two different tables named my_table and MY_TABLE, but on Windows these two names are considered identical. To avoid data transfer problems arising from lettercase of database or table names, you have two options: I've gone for the second option, to set my Windows system to lower_case_table_names=2. Easy? Not quite yet. In theory you can set this via the my.ini Setup tab in WinMySQLadmin. But on my system at least (Windows XP, MySQL installed with XAMPP), this did not work. So, to here: http://www.phpbuilder.com/board/showthre...t=10341962. Look at the 15th post. If running bradgrafelman's suggestion there works, then move on to the 17th post (here). He suggests doing a registry edit. I did something slightly different, which also seems to work: I went to C:\xampp\mysql\bin (the path may be different depending on your system - if you can't find it, then the MySQL registry key as noted in bradgrafelman's 17th post (see above) will help you find it). Open the my.ini file. In the section which begins Code: # The MySQL server Add the following line: Code: lower_case_table_names = 2 Save the file, then re-start your MySQL service. This seems to be working for me. |
Messages In This Thread |
MySQL table names forced to lower-case, and table_exists function case-sensitive ? - by El Forum - 01-06-2010, 01:38 PM
MySQL table names forced to lower-case, and table_exists function case-sensitive ? - by El Forum - 01-07-2010, 02:00 AM
MySQL table names forced to lower-case, and table_exists function case-sensitive ? - by El Forum - 01-07-2010, 02:04 AM
MySQL table names forced to lower-case, and table_exists function case-sensitive ? - by El Forum - 01-07-2010, 02:12 AM
MySQL table names forced to lower-case, and table_exists function case-sensitive ? - by El Forum - 01-07-2010, 02:15 AM
MySQL table names forced to lower-case, and table_exists function case-sensitive ? - by El Forum - 01-07-2010, 04:04 AM
|