View previous topic :: View next topic |
Author |
Message |
bgrosh Lurker

Joined: 05 Aug 2005 Posts: 9
|
Posted: Fri Aug 05, 2005 11:50 am Post subject: changed host |
|
|
Hi, I recently moved a website from one host to another. Now the calendar gives the message "Unable to connect to the database server at this time."
I'm not even sure what version I'm using, since all I can see is the above error message.
I downloaded the database and then uploaded it to the new site. I can see it through the PHPMyAdmin panel, and it looks fine. In the process it acquired a new username and password. I changed these in the dbConnect.inc file. One thing that bothers me is that I tried changing the error message that appears in this file, but it doesn't change the error message I see in the browser, which makes me think it's somehow not loading this file properly.
I also went into the config.php file and changed the $dbConnect path in line 8 and the database name in line 15.
Sorry to bother you with this. I tried searching the forums but couldn't find changing hosts referred to. |
|
Back to top |
|
 |
Dan Admin / Developer

Joined: 19 Feb 2001 Posts: 2057
|
Posted: Fri Aug 05, 2005 11:57 am Post subject: |
|
|
Well, you're on the right track. The dbConnect.inc file is what issues that error message if the MySQL hostname/username/password are incorrect, so you know the config.php include path to it is right. The fact that you couldn't get the error message to change tells me one of two things:
1) You've got a persistent cache issue. Try deleting the file, refreshing the browser, then re-uploading, or something to that effect.
2) Is it possible you've got two copies of dbConnect.inc installed on the server and it's not using the one you edited?
Cheers,
Dan |
|
Back to top |
|
 |
bgrosh Lurker

Joined: 05 Aug 2005 Posts: 9
|
Posted: Fri Aug 05, 2005 12:34 pm Post subject: |
|
|
Well, I deleted the dbConnect.inc file and refreshed my browser, and it still didn't change the error message. So that suggested that the error message is coming from some other file.
Next, I searched for the text of the error message. Sure enough, I discovered that I had inserted the text of the dbConnect.inc file into the config.php file at line 420 when I had trouble getting the thing to run in the first place on the old server. I know this wasn't kosher, but I couldn't quite see how it was less secure than the .inc file and it let it work. So I changed the username and password and error message there and refreshed and got the new error message. So that's where it's coming from.
Just tried commenting out that insertion of the include file into the config file and go back to the original error message, which suggests it comes from somewhere else. That is not in the config file, however. Just did a search of the whole folder and found it only in language_english.php. |
|
Back to top |
|
 |
Dan Admin / Developer

Joined: 19 Feb 2001 Posts: 2057
|
Posted: Fri Aug 05, 2005 12:42 pm Post subject: |
|
|
Ah, that makes a lot more sense!
There are two separate error messages you could be getting (since relabled to be less confusing): one for being unable to load the dbConnect.inc file (translated in the language file), and one for being unable to connect to the database (straight English). Make sure to double check which error message you're getting so you know where it's coming from. The wording is too similar for both of them, which leads to the confusion. If you're getting the message from the language file, that implies your error is now the include path to dbConnect.inc.
There's nothing really wrong with putting the database connection code right in the config file, unless your server is terribly misbehaved and allows code to be viewed through the browser. I've yet to see a setup that does that, despite the warnings...
Cheers,
Dan |
|
Back to top |
|
 |
bgrosh Lurker

Joined: 05 Aug 2005 Posts: 9
|
Posted: Fri Aug 05, 2005 1:30 pm Post subject: |
|
|
OK, but I've I've put the inc file into the config file, and I'm getting the error message from the inc file that's included directly into the config file, so the incorrect path is not the obstacle. Right? but it still doesn't work. |
|
Back to top |
|
 |
Dan Admin / Developer

Joined: 19 Feb 2001 Posts: 2057
|
Posted: Fri Aug 05, 2005 1:44 pm Post subject: |
|
|
Did you comment out the original $dbConnect include?
I'll probably need to take a look at your config file and error message, as it isn't overly clear what all you're working with at this point.
Cheers,
Dan |
|
Back to top |
|
 |
bgrosh Lurker

Joined: 05 Aug 2005 Posts: 9
|
|
Back to top |
|
 |
Dan Admin / Developer

Joined: 19 Feb 2001 Posts: 2057
|
Posted: Fri Aug 05, 2005 2:09 pm Post subject: |
|
|
Yeah, an email attachment would be good.
Quote: | Guess you can't see it online, right? |
Hopefully not!
Cheers,
Dan |
|
Back to top |
|
 |
|