Solved

MySQL Table Names revert to LOWER CASE ?

Posted on 2004-08-23
7
889 Views
Last Modified: 2012-06-21
Hi,

I currently administer our MySQL db version 3.23.56 on a LINUX Cobalt Qube server via an external fron-end piece of software.
My Table Names have capital letters at the beginning, i.e. StockMovements, OrderLines.....

We are now implementing a cross-over to a Windows Server 2003 machine.
I have installed MySQL version 4.0.20a and initially it was stated as 4.0.20a-debug. I managed to find another piece of software to take it out of debug mode as I thought this would help with the table names.
The version is now 4.0.20a-max.

If I rename the imported tables say from orderlines to OrderLines, it stays, but if I refresh or close/re-open my front-end, all the table names have reverted back to lower case ?

I have lots of .asp apps which are currently working of my Linux MySQL db using Capitals in the table names and fields. Obviously I do not wish to start re-coding all my web pages.

Please can anyone shed some light on this issue ?

Thanks

David
0
Comment
Question by:scene
  • 4
  • 2
7 Comments
 
LVL 26

Expert Comment

by:ushastry
Comment Utility
Hi,

Use this command to rename mysql tables.

RENAME TABLE oldName TO newName

http://dev.mysql.com/doc/mysql/en/RENAME_TABLE.html

Hope this helps!
0
 
LVL 7

Expert Comment

by:petoskey-001
Comment Utility
In windows, there is no Case Sensitive options.

If you do "show variables like '%case%' you should get...
+------------------------+-------+
| Variable_name          | Value |
+------------------------+-------+
| lower_case_table_names | 1     |
+------------------------+-------+

You can rename the tables, but it shouldn't matter.  Since your MySQL server is not case sensitive (on windows) you shouldn't have to recode your web apps.  They will just default to the lowercase versions.  Let me know if you end up getting errors.  My guess is it will work just fine as is.
0
 
LVL 7

Expert Comment

by:petoskey-001
Comment Utility
Oh, the reason is that the table name case doesn't matter is the name of the table is taken from a file search (FRM, MYD, MYI) in the database directory.  So unless you have two tables like "orderlines" and "OrderLines", you won't have any problems.
0
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 

Author Comment

by:scene
Comment Utility
Thanks for your posts.
IOn my current Linux version I have the variable

 lower_case_table_names = 0 (Not 1)

Should I not find a way to change the variable in the windows version to also show 0 ?
I have tried adding a line to the my.ini file, but this seems to make no difference ?

David
0
 
LVL 7

Expert Comment

by:petoskey-001
Comment Utility
Well windows itself is not case sensitive.  So telling MySql to try to be case sensitive when the underlying operating system isn't doesn't work.  MySQL is really simple, and table names are taken from file names.

This is also the reason why it won't affect your scripts.  On Linux your select statements had to be case sensitive.  On Windows they don't have to be.  So "select * from orderlines" and "select * from OrderLines" will both work.  Try the MySQL commaind line client connected to your windows db server.  You should see that both work with no errors.
0
 
LVL 7

Accepted Solution

by:
petoskey-001 earned 125 total points
Comment Utility
Hello scene.  It's been about a week.  Have you had a chance to test things out?  You should find it all works for you regardless of case on Windows.  The lower_case_table_names is more to make thing on Linux work the way they do on Windows the the other way around.
0
 

Author Comment

by:scene
Comment Utility
Hi,

Yes you are quite right.....my scripts do work.
Thank you all for you prompt responses.
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Introduction In this article, I will by showing a nice little trick for MySQL similar to that of my previous EE Article for SQLite (http://www.sqlite.org/), A SQLite Tidbit: Quick Numbers Table Generation (http://www.experts-exchange.com/A_3570.htm…
All XML, All the Time; More Fun MySQL Tidbits – Dynamically Generate XML via Stored Procedure in MySQL Extensible Markup Language (XML) and database systems, a marriage we are seeing more and more of.  So the topics of parsing and manipulating XM…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now