MySQL Dump Export/Import And Table Name Case Sensitivity

Before Blojsom 3, I could get away with moving my blog content from my web host to my home environment (and vice versa) simply by moving the text files. Now that I’m using MySQL for Blojsom 3, I figured that the easiest way is to use MySQL dump.

Export to the dump file: mysqldump -p -u [username] [dbname] > [dumpfile].sql Import from the dump file: mysql -p -u [username] [dbname] < [dumpfile].sql This might not be a good solution if you have a large amount of records, but that will do for me for now. It’s also easy enough to delete the irrelevant bits from the dump file and only move the content you want.

All went well, until I started deploying Blojsom 3 to my web host which is running Linux (I use Windows at home).

Dec 09 06:38:13 ERROR [Thread-1] util.JDBCExceptionReporter - Table 'dbname.Blog' doesn't exist

Blojsom’s .hbm.xml files specify all table names to be MixedCase, and strangely when I set up the tables using blojsom-full-initial-data-mysql.sql (which specifies MixedCase table names as well) on my Windows environment, the table names are created as all lower case, which then ended up in my web hosting environment as all lower case again and then Hibernate complained about case sensitivity.

Not wanting to rebuild the tables again, I changed the .hbm.xml files to have lower case table names. It was quick, but thinking of it now, it’s definitely going to cause me grief in the future when I need to replace those .hbm.xml files if someday a Blojsom upgrade requires them to be replaced.

Share Comments
comments powered by Disqus