1
Shelia
Unable to connect to database
  • 2006/6/22 1:03

  • Shelia

  • Not too shy to talk

  • Posts: 140

  • Since: 2003/6/22


I am not able to connect to my database due to an error in class/database/databasefactory.php line 34 Below is the piece of the code that is causing the error. This is strange an may be a server issue instead of an XOOPS issue. Any ideas?

function &getDatabaseConnection()
{
static $instance;
if (!isset($instance)) {
$file = XOOPS_ROOT_PATH.'/class/database/'.XOOPS_DB_TYPE.'database.php';
require_once $file;
if (!defined('XOOPS_DB_PROXY')) {
$class = 'Xoops'.ucfirst(XOOPS_DB_TYPE).'DatabaseSafe';
} else {
$class = 'Xoops'.ucfirst(XOOPS_DB_TYPE).'DatabaseProxy';
}
$instance =& new $class();
$instance->setLogger(XoopsLogger::instance());
$instance->setPrefix(XOOPS_DB_PREFIX);
if (!$instance->connect()) {
trigger_error("Unable to connect to database", E_USER_ERROR);
}
}
return $instance;
}

2
Bassman
Re: Unable to connect to database
  • 2006/6/22 1:26

  • Bassman

  • Friend of XOOPS

  • Posts: 1272

  • Since: 2003/5/23


That's a generic error you get when there's something wrong with the database or connection. Was your site working before the error? If so, the MySQL server could be down.

3
brash
Re: Unable to connect to database
  • 2006/6/22 1:27

  • brash

  • Friend of XOOPS

  • Posts: 2206

  • Since: 2003/4/10


Might like to check out this FAQ
IT Headquarters
Innovative IT Solutions

4
Chris03
Re: Unable to connect to database
  • 2006/6/22 5:58

  • Chris03

  • Quite a regular

  • Posts: 372

  • Since: 2004/2/22


My site gets this alot....esp when its under load, mainly when the image gallery is being hit hard. Seems MySQL doesnt respond... or there is a limit on the connection attempts per user to MySQL for my user. Enabling caching fixed this anoyyance. Wish we could have a "SQL Server Busy Try Again Later" error.
KickassAMD

Login

Who's Online

360 user(s) are online (266 user(s) are browsing Support Forums)


Members: 0


Guests: 360


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits