Drupal

Externe database aanspreken vanuit Drupal

You need add the followings lines in settings.php for connecting ‘external’ database.

$databases[‘default’][‘default’] = array(
‘database’ => ‘drupal8’,
‘username’ => ‘username’,
‘password’ => ‘password’,
‘prefix’ => ”,
‘host’ => ‘localhost’,
‘port’ => ‘3306’,
‘namespace’ => ‘Drupal\\Core\\Database\\Driver\\mysql’,
‘driver’ => ‘mysql’,
);

$databases[‘external’][‘default’] = array(
‘database’ => ‘external’,
‘username’ => ‘username’,
‘password’ => ‘password’,
‘prefix’ => ”,
‘host’ => ‘localhost’,
‘port’ => ‘3306’,
‘namespace’ => ‘Drupal\\Core\\Database\\Driver\\mysql’,
‘driver’ => ‘mysql’,
);

Advertisements