4

I am running Blogengine.Net and have noticed that the tables are all created lower case (table name be_settings) but a lot of the queries are written mixedcase (Select * from be_Settings). This works fine if your MySql instance is running on Windows or set for capatability with Windows. I am getting an error as my hosting provider MySql instance is case sensitive. Is there a setting I can change to fix this error through phpMyAdmin? I don't want to have to fish through all of the code and fix BlogEngine.Net if I don't have to.

4 Answers 4

3

Case sensitivity in MySQL table names is specific to the OS. MySQL data is stored in files, which are subject to whatever rules the OS enforces. Linux IS case-sensitive, for example.

There is a variable 'lower_case_table_names' that can be manipulated, but it seems like you'd have to recreate all your tables.

http://dev.mysql.com/doc/refman/5.0/en/identifier-case-sensitivity.html

1

The setting you are after is lower_case_table_names (set to 1 or 2). Unfortunately, this would need to be set on the MySQL daemon start, not through phpmyadmin. Could you ask your hosting provider to do this for you?

1

If you are trying to solve this for BlogEngine.Net you can easily rename all of the tables to use CamelCase as all of the queries in BlogEngine.Net are written using CamelCase.

0

How is the database being created? You might find that the queries which create the tables are using the correct case:

CREATE TABLE be_Settings ( ... )

It's just that myisam tables are stored as files in the filesystem, and since it's on Windows, they're just converted to lower case. If you create the database from these queries on a linux system, you'll find that all the tables are in the correct case.

The lesson from this is to always make tables names lower case...

2
  • If only BlogEngine.Net had followed this rule. Jun 2, 2009 at 12:24
  • I checked and all Tables are using InnoDB. I was able to rename all of the table using phpMyAdmin so that they use camelcase as Blogengine.Net uses camelcase in all of the queries Jun 2, 2009 at 20:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.