Tuesday, October 1, 2013

When two (tables) are really one

I had a funny issue where table in known working script was not found.

Error Executing Database Query
Table 'tableone' doesn't exist

It had a camel case name and I could see a table from the mysql cli, but not in phpmyadmin. It was strange because there were two versions of the table, TableOne and tableone. My first thought was to delete it from the cli, but that ended up deleting them both. I recreated the table and reinserted the data but the two tables showed up again.

Later on in the day I had a coworker tell me they had to change the mysql config to add the following in order to support a piece of software.

lower_case_table_names=1

Here is was it does:
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.

I removed that line from the config and restarted mysql and the script worked.

No comments:

Post a Comment