Wednesday 18 May 2011

moving MySQL db from windows to linux



The problem: All my tables have names in capital...MySQL in windows ignores capital case..in Linux this is not the case!!

Therefore all my queries in linux throw:

org.hibernate.exception.SQLGrammarException: could not execute query
Caused by: com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: Table 'mydb.MY_TABLE' doesn't exist

Solution: edit /etc/mysql/my.cnf and set
[mysqld]
lower_case_table_names=1

restart mysql:
$ sudo service mysql restart




References
http://dev.mysql.com/doc/refman/5.0/en/server-system-variables.html#sysvar_lower_case_table_names
http://forums.mysql.com/read.php?10,51529

No comments:

Post a Comment