Hi there, I have a error when I try to install drupal 7.28. I am using xampp. I had not encountered this error when using drupal 7.27. The error code is below.

DatabaseConnectionNotDefinedException: The specified database connection is not defined: default in Database::openConnection() (line 1678 of Y:\xampp\htdocs\sunriserealty-web\includes\database\database.inc).

Please help. Thanks

Comments

The Webmaster Centre Ltd’s picture

Look in your settings.php - have you defined the database settings there?

tarun_nagpal’s picture

Hello Sergio,
This error usually comes when the specified Database is not found by the server.

If you closely look at the error you come to notice that the DB not found. Here is the code where it comes

// If the requested database does not exist then it is an unrecoverable
    // error.
    if (!isset(self::$databaseInfo[$key])) {
      throw new DatabaseConnectionNotDefinedException('The specified database connection is not defined: ' . $key);
    }

So what i can suggest is to cross check your DB name, hostname and the password. It will be in your settings.php.

Path for settings.php root_folder\sites\default\settings.php
Path for error code (optional) root_folder\includes\database\database.inc.

Please feel free to contact if i can help you more.

Regards
Tarun Nagpal

Hope is the last thing to be lost...!

iam_serg’s picture

Sorry for the wait...was a bit busy. Drupal did install correctly.
But now I'm getting the same error with Drupal 7.31.

When i go to install drupal this is what happens, same as before:

1) Select an installation profile: Standard or Minimal. I choose Standard.
2) Choose language. I choose English.

From there, I don't get the page where I input my database info and password.
it just goes to the following error.

DatabaseConnectionNotDefinedException: The specified database connection is not defined: default in Database::openConnection() (line 1678 of Y:\xampp\htdocs\testsite-d7\includes\database\database.inc).
The website encountered an unexpected error. Please try again later.

Drupal is skipping a page. Not sure why?

iam_serg’s picture

This problem is caused because on installing drupal, the installation is skipping the page where you input the information for the database. I can't get around that. I'm having the same problem when installing drupal commerce kickstart 2.

I can install drupal via drush, but this time around I was installing kickstart 2.

Would appreciate the help. thanks,

dreizwo’s picture

I ran into this issue when using a custom profile. In my case the problem was, that I added a dependency to xautoload module in the .info file. The __xautoload_register_drupal() function, wich is called when requiering the module, tries to registers Drupal-related namespaces - this will cause an uncatched exception.
After disableing the xautoload module it works as expected...