Confusing behaviour, mantis suddenly pointing at wrong DB.

Get help from other users here.

Moderators: Developer, Contributor

Post Reply
lodgemonkey
Posts: 4
Joined: 05 Apr 2005, 19:54

Confusing behaviour, mantis suddenly pointing at wrong DB.

Post 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
lodgemonkey
Posts: 4
Joined: 05 Apr 2005, 19:54

Post by lodgemonkey »

I should add, I'm running Mandrake 10.1, Apache 2.0.50, php 4.3.8.

In case that helps... Thanks.
thraxisp
Developer
Posts: 509
Joined: 14 Feb 2005, 03:38
Location: Ottawa, Canada
Contact:

Post by thraxisp »

I assume that the "localhost" listed is replaced by the actual computer name. Could this be a DNS or ARP cache problem?
lodgemonkey
Posts: 4
Joined: 05 Apr 2005, 19:54

Post 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
thraxisp
Developer
Posts: 509
Joined: 14 Feb 2005, 03:38
Location: Ottawa, Canada
Contact:

Post 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.
lodgemonkey
Posts: 4
Joined: 05 Apr 2005, 19:54

Post 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
Post Reply