Click here to Skip to main content
13,192,426 members (48,662 online)
Click here to Skip to main content
Add your own
alternative version


2 bookmarked
Posted 27 Mar 2011

Camel Case Table Names in MySQL

, 27 Mar 2011
Rate this:
Please Sign up or sign in to vote.
A solution to casing problems in MySQL

I have been working with Entity Framework 4 and MySQL. The main problem I have found is that since I am working on a Windows server, the table names in the database are all lower case. This means that when I create the entities in Visual Studio, the classes are all lower case.

So I have found this solution:

There is a setting in the configuration file in the MySQL server directory. I am using Windows 7, so this was under: C:\Program Files (x86)\MySQL\MySQL Server 5.5C:\Program Files (x86)\MySQL\MySQL In this Server 5.5\.

In this directory, you will find a file: my.cnf. This governs how MySQL runs. You will need to change or add a line to allow Camel casing of table names. Please note that you should read This details the changes and how they should be used on different Operating Systems. I am only detailing how I got this to work on Windows. If you are running Linux, then please go to the link mentioned above to make sure that the change will not affect your system / MySQL instance.

Steps taken to allow Camel casing:

  • Go to Control Panel –> Administrative Tools –> Services.
  • Stop the MySQL Service.
  • Open C:\Program Files (x86)\MySQL\MySQL Server 5.5C:\Program Files (x86)\MySQL\MySQL In this Server 5.5\.
  • Open the my.cnf file as Administrator.
  • Add the line lower_case_table_names=2 under the mysqld section. If this line is there, then just change the value to ‘2’. Make sure that there is only one line there.
  • Go back to Services and restart MySQL.

You should be done. Hope this short guide has helped.


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Software Developer (Senior)
United Kingdom United Kingdom
No Biography provided

You may also be interested in...


Comments and Discussions

GeneralThanks! Pin
Mertiin13-Jul-14 21:17
memberMertiin13-Jul-14 21:17 
GeneralVery good post to learn MySQL Pin
Kelly Blue17-Jun-11 20:54
memberKelly Blue17-Jun-11 20:54 
Oh this is a great tutorial!!! It’s help me a lot.
Of course i find some very userful MySQL examples with ready made code examples and output screenshot.

Kelly Blue
University of Technology, Sydney, Australia

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.171017.2 | Last Updated 27 Mar 2011
Article Copyright 2011 by stephen.vaubell
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid