Page 1 of 1

Confusing behaviour, mantis suddenly pointing at wrong DB.

Posted: 05 Apr 2005, 20:02
by lodgemonkey
Hi all,
I had set up mantis last month, and everything was happily running. I have the database on a separate box that supports RAID-5. Anyway, upon returning from a recent business trip I noticed that Mantis is reporting
==========================
Application Error #400
Database connection failed. Error Received from database was #1044: Access denied for user "@"localhost to database bugtracker.
==========================

The strange thing is, when you run the admin/check.php all is good.

So I've taken a dump of the database, but do not wish to import locally if I can avoid it. All functionality mail, was working now it just seems to be pointing at the wrong DB. I suspect it's a global variable setting but the config_inc.php is set up for the correct database. Is there somewhere else I should be including the database connection info?

Thanks in advance,

-Rich

Posted: 05 Apr 2005, 20:09
by lodgemonkey
I should add, I'm running Mandrake 10.1, Apache 2.0.50, php 4.3.8.

In case that helps... Thanks.

Posted: 07 Apr 2005, 13:39
by thraxisp
I assume that the "localhost" listed is replaced by the actual computer name. Could this be a DNS or ARP cache problem?

Posted: 07 Apr 2005, 15:47
by lodgemonkey
No it's actually 'localhost', which lead me to assume that it was not reading the config_inc.php correctly. I can run mysql from the command line to the database correctly, eg.
mysql -h <othermachine.withdatabase.com> -u root -p

So I don't believe it's a dns issue. Can correctly run nslookups on the machine as well.

-R

Posted: 07 Apr 2005, 19:45
by thraxisp
The default for hostname is "localhost" and the database user is "root". The admin/check.php page uses the same access routines, but may suppress error messages. It looks like "$g_hostname" is getting clobbered somewhere in your config_inc.php file.

Posted: 07 Apr 2005, 21:28
by lodgemonkey
Well thanks for your help thraxisp, I've had to resort to importing the database locally. It's a workaround that will do for now. If I figure out a more permanent solution I'll post it.

grepping through the php files I did not find any occurance where the $g_hostname would have been over-written.

Thanks again though.

-R