AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   HLstatsX:CE (https://forums.alliedmods.net/forumdisplay.php?f=156)
-   -   Weird MYSQL 1146 Error (https://forums.alliedmods.net/showthread.php?t=203711)

xyle 12-22-2012 15:28

Weird MYSQL 1146 Error
 
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 12-22-2012 15:34

Re: Weird MYSQL 1146 Error
 
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 12-22-2012 15:47

Re: Weird MYSQL 1146 Error
 
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!

xyle 12-22-2012 15:58

Re: Weird MYSQL 1146 Error
 
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 12-22-2012 16:22

Re: Weird MYSQL 1146 Error
 
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 12-22-2012 17:15

Re: Weird MYSQL 1146 Error
 
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...

psychonic 12-22-2012 17:46

Re: Weird MYSQL 1146 Error
 
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.

xyle 12-22-2012 23:47

Re: Weird MYSQL 1146 Error
 
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!!


All times are GMT -4. The time now is 08:51.

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