Webmastersite.net
Register Log In

Cannot Connect to Database
Connection to Database impossible

Comments on Cannot Connect to Database

searcher1
Member

Usergroup: Customer
Joined: Apr 18, 2004
Location: London, UK

Total Topics: 9
Total Comments: 16
Posted Apr 30, 2009 - 6:26 AM:

Hello,
I have just installed the script (mainly as a test) on my new hosting provider. Previously I had my own server but alas the return of that is resting on financial probabilities.
Anyhow when I tap in the url I get the following:

Cannot establish a database connection.
MySQL returns the error . (It's possible that the web host's database is currently down, if so this is a temporary error and will go away when the database is accessible again.)
WSN Links 5.0.45

Unfortunately this is always what appears. The installation went perfectly but that's the screen immediately after and is always showing. My hosting provider tells me that the links are correct and whilst I told them that there seemed to be 'no permissions' (showing in red) in phpMyadmin they said it was fine and anyhow I'm unable to change stuff in there. I can see 34 tables have been made and the Mysql version is 5.0.22 / php 5.2.9 and the hosting server is through Plesk. Their tech keep asking me if the script is looking for a particular version of php and I'm quickly starting to think they are none too hot on things.
Some help/comments?

Michael
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
Posted Apr 30, 2009 - 11:47 AM:

That PHP/MySQL version combo is exactly what I'd recommend and use, no problem.

I don't see how the installation process could ever complete when a page itself can't, since they use the same code. If the installation had died with an error this could make some kind of logical sense, but it doesn't.

Test your mysql info in servertest.php and see if it gives any suggestions. If it works in servertest.php, double check config.php to be sure that's the info in there.

Note that installation service is free: scripts.webmastersite.net/w...ustom=yes&TID=installation
searcher1
Member

Usergroup: Customer
Joined: Apr 18, 2004
Location: London, UK

Total Topics: 9
Total Comments: 16
Posted Apr 30, 2009 - 4:27 PM:

results:

Output buffering - pass
PHP version 5.2.9 - pass
Remote URL functions - pass
Apache mode with FTP extension - pass
Linux - pass
GD bundled (2.0.34 compatible) - pass
Maximum Execution Time (800 seconds) - pass
Allowed Memory (256M) - pass

Congratulations, this server meets all the recommendations for running WSN Links.


MySQL version 5.0.51b-community-nt-log - pass

Access to the database was established. Everything is good.

...........
The upload paths in config.php have trailing slashes - is that okay (see below)?
config.php is correct because I copied the data from there to the servertest.php screen


$dirurl = 'http://xxxxxxx.org/Links/';
$uploadpath = '/var/www/vhosts/xxxxxxx.org/httpdocs/Links/attachments/';
$rejectspiderlevel = '';
$rejectguestlevel = '';
$ftphost = '';
$ftpuser = '';
$ftppass = '';
$ftpdir = '';
...........

Michael
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
Posted May 01, 2009 - 9:29 PM:

The trailing slash on your $dirurl value is bad, though completely unrelated. Only $uploadpath is supposed to have the trailing slash. The fact that the $dirurl could have the slash suggests that you may have been doing custom editing rather than using the script's installation process -- which automatically remove trailing slashes -- and that would be the real problem. Please use autosetup.php or setup.php, there are no other supported installation methods and manual file editing is certainly a bad way to do it.
searcher1
Member

Usergroup: Customer
Joined: Apr 18, 2004
Location: London, UK

Total Topics: 9
Total Comments: 16
Posted May 02, 2009 - 9:08 AM:

Paul wrote:
The trailing slash on your $dirurl value is bad, though completely unrelated. Only $uploadpath is supposed to have the trailing slash. The fact that the $dirurl could have the slash suggests that you may have been doing custom editing rather than using the script's installation process -- which automatically remove trailing slashes -- and that would be the real problem. Please use autosetup.php or setup.php, there are no other supported installation methods and manual file editing is certainly a bad way to do it.


Paul - I never touched the config.php file. The installation was 100% through the autosetup.php and if I'd done anything I would have said it - that's why it was a question rather than a statement.

So the solution to the 'cannot connect to database' is? Re-run autosetup.php maybe?
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
Posted May 02, 2009 - 8:46 PM:

If you're not going to let me see your website URL and the actual content of config.php, then the only thing I can suggest is re-running autosetup.php.

Fixing autosetup to trim the / properly.
searcher1
Member

Usergroup: Customer
Joined: Apr 18, 2004
Location: London, UK

Total Topics: 9
Total Comments: 16
Posted May 03, 2009 - 8:13 AM:

Paul wrote:
If you're not going to let me see your website URL and the actual content of config.php, then the only thing I can suggest is re-running autosetup.php.

Fixing autosetup to trim the / properly.


Well Paul actually I thought - Delete the installation and start again. Just waiting for a reply from the hosting company (and I will let you know) as I could not delete the .js files and see they are 'owned by Apache'. Once that's done I'll do a reinstall.
Michael
Search thread for
Download thread as
  • 0/5
  • 1
  • 2
  • 3
  • 4
  • 5



Sorry, you don't have permission to post posts. Log in, or register if you haven't yet.