Raised This Month: $12 Target: $400
 3% 

Weird MYSQL 1146 Error


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
xyle
Junior Member
Join Date: Dec 2012
Location: Nevada
Old 12-22-2012 , 15:28   Weird MYSQL 1146 Error
Reply With Quote #1

I have a personal game server, webserver and hlxce running on it. I was going to set up the hlxce to run on my actual website, so I set up the mysql database and got everything connected, but when I goto mywebsite/hlstatsx.php I get this error...

Server Error: (1146) Table 'dbName.hlstats_Options' doesn't exist

I noticed Options in the error is capitalized, so I changed the table to Options and now get this error...

Server Error: (1146) Table 'dbName.hlstats_Games' doesn't exist

This is pretty strange because everything works great on my home server. I copied the hlstatsx folder from my WWW directory to the actual website, altered the config.php to match the website mysql settings.

Any input would be greatly appreciated!!
xyle is offline
xyle
Junior Member
Join Date: Dec 2012
Location: Nevada
Old 12-22-2012 , 15:34   Re: Weird MYSQL 1146 Error
Reply With Quote #2

lol, the database on my home server matches the database in the website.
If I run localhost/hlstatsx, I get the proper page with stats, all good
If I run mywebsite/hlstatsx, I get the 1146 Table not found error, because of the captalization. I can go through and change all the table names, but this wouldn't be good.

Thanks for any help!
xyle is offline
xyle
Junior Member
Join Date: Dec 2012
Location: Nevada
Old 12-22-2012 , 15:47   Re: Weird MYSQL 1146 Error
Reply With Quote #3

Poking around the status.php in the hlstatsx directory I found this...

FROM
hlstats_Teams

on line 349. There isn't a hlstats_Teams table in the database, its called hlstats_teams.

Is there some option I can set somewhere to disregard capitalization?

The strange part is this works on my home server but not on my website. Might be a difference in PHP, Perl or MySQL versions(?)

Thanks for any help!

Last edited by xyle; 12-22-2012 at 15:48.
xyle is offline
xyle
Junior Member
Join Date: Dec 2012
Location: Nevada
Old 12-22-2012 , 15:58   Re: Weird MYSQL 1146 Error
Reply With Quote #4

Ahhhh Haaa!
My home server is windows based, while my website host is linux based!
Now to try and find where I can change this...

lol
xyle is offline
xyle
Junior Member
Join Date: Dec 2012
Location: Nevada
Old 12-22-2012 , 16:22   Re: Weird MYSQL 1146 Error
Reply With Quote #5

According to net, setting Collation of table to "utf8_general_ci" makes the table case insensitive, but I verified both databases, the one on my home server and the one on my website and both already show this Collation setting. So this is not the case. (Ok, pun intended, lol).

the PHP files from hlstatsx are requesting data from the database using capitalized table names which are returning the 1146 error, table does not exist.

I verified php version and even tried different versions, but that didn't do anything. My website MySQL version is newer than my home server version. But I dont think I will change that right now.

I'll keep pluggin away...
xyle is offline
xyle
Junior Member
Join Date: Dec 2012
Location: Nevada
Old 12-22-2012 , 17:15   Re: Weird MYSQL 1146 Error
Reply With Quote #6

Ok, I see the original install.sql file used in setting up HLXCE has the tables named properly, but since I installed this on a windows machine, the table names got altered which I then imported into my linux based Website database, hence the error.

Since I have populated tables, I will see what I need to do in order to get this corrected. Probably, re-import the original install.sql, make sure case sensitive is on in the database on the windows machine, import the existing data, then move this to the website. lol

Dang...
xyle is offline
psychonic

BAFFLED
Join Date: May 2008
Old 12-22-2012 , 17:46   Re: Weird MYSQL 1146 Error
Reply With Quote #7

MySQL table names follow filesystem case-(in)sensitivity.

On Windows, they're case-insensitive, but will convert everything to lowercase upon creation.

On linux, they're case-sensitive.

If you move the db from Windows to linux, you do indeed need to rename them to restore any caps.
psychonic is offline
xyle
Junior Member
Join Date: Dec 2012
Location: Nevada
Old 12-22-2012 , 23:47   Re: Weird MYSQL 1146 Error
Reply With Quote #8

Thanks for the input I really appreciate it!

Maybe in the tutorial for setting up hlxstats for windows, someone may want to add a line in there about doing the following before the install.sql is imported into the database...
- After wamp or zamp is installed and running
- Stop the MySQL service
- Open the My.ini file for editing
- add the line "lower_case_table_names=0" without quotes to the end of the file, if the var is not present
- save the file
- restart the MySQL service in wamp or zamp

Doing this will insure the capitalization remains in the tables when the install.sql file is imported.

I scrubbed my old stats and did this so the database is the same between my windows server and the linux server.

Thanks!!
xyle is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 04:11.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode