Hello,
As I upgraded to D7.19, I somehow lost my settings.php file. I have older settings.php files but the present default-settings.php looks quite different. So I tried to edit default-settings.php, adding this on line 213 where it says $databases = array();
Here's my edit

$databases = array(
  'driver' => 'mysql',
     'database' => 'foobase',
     'username' => 'foouser',
      'password' => 'foopasswd',
      'host' => 'foohost',
      'prefix' => '',
    );

Is this allright or should I add anything else, like base_url?
Permissions are 644 and I have removed default.settings.php

In .htaccess, I have only uncommented Rewrite Base /

I ran update.php and got a long list of errors.
Here's the list of errors:

Warning: Invalid argument supplied for foreach() in Database::parseConnectionInfo() (line 1505 of /data/web/…/htdocs/includes/database/database.inc).
Warning: Invalid argument supplied for foreach() in Database::parseConnectionInfo() (line 1505 of /data/web/…/htdocs/includes/database/database.inc).
Warning: Invalid argument supplied for foreach() in Database::parseConnectionInfo() (line 1505 of /data/web/…/htdocs/includes/database/database.inc).
Warning: Invalid argument supplied for foreach() in Database::parseConnectionInfo() (line 1505 of /data/web/…/htdocs/includes/database/database.inc).
Warning: Invalid argument supplied for foreach() in Database::parseConnectionInfo() (line 1505 of /data/web/…/htdocs/includes/database/database.inc).
Warning: Invalid argument supplied for foreach() in Database::parseConnectionInfo() (line 1505 of /data/web/…/htdocs/includes/database/database.inc).
DatabaseConnectionNotDefinedException: The specified database connection is not defined: default in Database::openConnection() (line 1659 of /data/web/…/htdocs/includes/database/database.inc).

Many thanks in advance for your help :-)

Comments

libre fan’s picture

For those whom this can help, here's the right pattern:

$databases = array (
  'default' => 
  array (
    'default' => 
    array (
  'driver' => 'mysql',
     'database' => 'nameofyourdatabase',
     'username' => 'databaseusername',
      'password' => 'yourpasswdtothedatabase',
      'host' => 'foohost',
      'prefix' => '',
      ),
    ),
);

As the Drupal documentation says, Don't forget to edit (line 239):

$update_free_access = FALSE;

Replacing FALSE by TRUE if you aren't logged in as admin.

And bob's you uncle ;-)

After updating, don't forget to set the line back to "FALSE", for obvious reasons.

And I'm not forgetting to save this settings.php file, just in case ;-)

Cheers