Board index   FAQ   Search  
Register  Login
Board index php forum :: Database MySQL Installation

table letter case and my.cfg on linux

Installation and configuration iussues

Moderators: macek, egami, gesf

table letter case and my.cfg on linux

Postby minimihi » Sun Apr 22, 2012 7:48 am

Today is my second day that I'm setting up LAMP on my office laptop.

On first day I installed Ubuntu and tried to install LAMP but failed since I got some problem with mySQL and PhpMyAdmin. And to addition Ubuntu was lagging to much <_< old laptop.
On second day, thats toady, I switched to OpenSUSE. Since I spent some time trying to set up LAMP on Ubuntu, now it was much easier.
But I still encountered such problems as multiple virtual hosts, mod rewrite, .htaccess allowance.
Anyways I solved all those problems and my sites are looking just fine (Thanks for reading untill here) :D Except for one.

That one site is using uppercase table names in mySQL queries.
When I was on Windows, in PHP code I wrote table names in uppercase (since using lower or upper cases for table names in code was of no difference).
eg.:
Code: Select all
SELECT * FROM TABLE_NAME

Everything was fine, no errors viewing pages. But now, on Linux, it's different.


Problem:
On Linux I imported my databases via PhpMyAdmin, everything looked same as before.
Everything was good, until I checked that page. That page throws errors that tables (in uppercase) don't exist. Yeah.. they don't, but exist in lowercase, with was still fine on Windows.

To fix that I opened /etc/my.cfg file and at the end of file inserted line:
Code: Select all
lower_case_table_names=2
which should convert table names to lower cases on lookup, restarted mySQL service and nothing, still same errors.
Later on I noticed that changing /etc/my.cfg file doesn't do anything, even when it's content is empty or just random letters.

So my options are that /etc/my.cfg isn't right file for entering that line OR
This options don't convert table names in queries.


Neither I want to rewrite table names to lowercase in my code, nor to covert them on queries (I'm using database class) :(
User avatar
minimihi
New php-forum User
New php-forum User
 
Posts: 238
Joined: Sat Apr 14, 2012 11:57 am
Location: Vilnius, Lithuania

Re: table letter case and my.cfg on linux

Postby minimihi » Sun Apr 22, 2012 8:17 am

Seems easiest way will be to rename tables names on database 8)

Sloved (rofl)
User avatar
minimihi
New php-forum User
New php-forum User
 
Posts: 238
Joined: Sat Apr 14, 2012 11:57 am
Location: Vilnius, Lithuania


Return to MySQL Installation

Who is online

Users browsing this forum: No registered users and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.

cron