cancel
Showing results for 
Search instead for 
Did you mean: 

Error establishing a database connection

chw
Newbie
Posts: 6
Registered: ‎24-05-2010

Error establishing a database connection

I have a wordpress blog hosted on the PlusNet CGI webspace. It was working after the server migration but as of Monday 28th April (or thereabouts) it seems to be failing to connect to the database.
Specifically, the page http://kerryfletcher.co.uk/ gives an error message "Error establishing a database connection".
However, if I go to http://ccgi.walshaw.plus.com/kerryfletcher/ it is working (although that page doesn't have any contents as such).
I haven't made any changes to the site for some months so it looks like something's been changed on the server or possibly something's going wrong with the domain hosting.
Help ....
Thanks,
Chris
7 REPLIES 7
spraxyt
Resting Legend
Posts: 10,063
Thanks: 674
Fixes: 75
Registered: ‎06-04-2007

Re: Error establishing a database connection

The DNS for kerryfletcher.co.uk still points to the legacy Plusnet CGI server which until the changes mentioned here were made last week will have been accessing the legacy MySQL servers.
To fix this you need to update the domain DNS entries to point to the migrated website on the new Hostopia servers as described in http://community.plus.net/hosting-faqs/.
When your files were migrated Plusnet/Hostopia should have made the changes necessary for access to the replacement Hostopia database.
David
chw
Newbie
Posts: 6
Registered: ‎24-05-2010

Re: Error establishing a database connection

Many thanks for your help. I'm still struggling with this though.
I have now changed the DNS entries as described in http://community.plus.net/hosting-faqs/ - see attached screenshot.
However, now, instead of getting "Error establishing a database connection", the website doesn't seem to be available at all.
BTW I am using the name servers ns1.force9.net and ns2.force9.net (which I was was using before the migration). I did try changing these but managed to break the email forwarding.
Thanks,
Chris
spraxyt
Resting Legend
Posts: 10,063
Thanks: 674
Fixes: 75
Registered: ‎06-04-2007

Re: Error establishing a database connection

I suggest adding a dot at the end of the left hand field on that A record. I was advised it wasn't needed for A records but dig shows the DNS entry has the domain name duplicated (the missing dot syndrome).
The name servers are correct as they stand. They aren't affected by the migration because Plusnet still host the domain and handle mail.
David
David
spraxyt
Resting Legend
Posts: 10,063
Thanks: 674
Fixes: 75
Registered: ‎06-04-2007

Re: Error establishing a database connection

Once DNS is fixed I think requesting www.kerryfletcher.co.uk will return the Root test page and adding /kerryfletcher/ will give a redirect_url to the address without www. Without www will give the Root test page or with /kerryfletcher/ the Not found page.
This suggests to me that intended .htaccess rewrites are not being applied. This could be because the .htaccess in /public is missing, is incomplete or contains RewriteCond patterns no longer applicable - specifically /~username which was needed on Plusnet ccgi but must be removed on Hostopia.
Hope this helps.
David
David
chw
Newbie
Posts: 6
Registered: ‎24-05-2010

Re: Error establishing a database connection

Yes - both replies were very helpful.
The dot fixed the DNS problem and got the test page showing.
And just now I fixed the .htaccess file and site is working again!!
Thanks so much for your help.
One further question you might know the answer to - ftp isn't fully working for me: I can login but it times out when I try to do "ls" or "dir". Other commands seem to work though (cd, del, put). Screenshot attached.
Cheers,
Chris
spraxyt
Resting Legend
Posts: 10,063
Thanks: 674
Fixes: 75
Registered: ‎06-04-2007

Re: Error establishing a database connection

Yep, site content displays now. Smiley
I think the FTP problem could be associated with needing to switch from passive mode to active mode - or vice-versa. I haven't tried using FTP in this way.
David
David
bobpullen
Community Gaffer
Community Gaffer
Posts: 16,886
Thanks: 4,977
Fixes: 316
Registered: ‎04-04-2007

Re: Error establishing a database connection

You need to use passive mode. The fact you can't use active mode is something I raised with our hosting partner a while back. It seems only to affect the European server cluster. I believe they have a case raised with one of their hardware vendors.

Bob Pullen
Plusnet Product Team
If I've been helpful then please give thanks ⤵