Saturday, July 15, 2006

mysql quick-tip

I just ran into an issue with rebuilding a mysql database for development, moving the database from a windows server to a linux one. By default windows mysql converts tables names to lowercase, when I imported the database onto my linux server all the filenames for the tables are also of course going to be lowercase. Unfortunately all of the app's queries refer to the tables with camel-case, probably the intention in the first place. Problem is, now my linux mysql instance cannot find any of these tables, because the filenames are lowercase. So how do we fix this? Well, luckily we can start mysql with the flag 'lower_case_table_names', set it to true and mysql will now force tables name to lowercase just like in windows:

[chris@myFC4box ~]$ sudo mysqld_safe --lower_case_table_names=1 --user=mysql

Hope that helps if anyone else gets in this bind!

0 Comments:

Post a Comment

<< Home