Q:

How to resolve my database connection error when using the Wordpress Migrate module? 

I have a Drupal8 site and I've installed the Wordpress Migrate module and it's dependencies for migrating a Wordpress site to Drupal8. 
When I start to import the exported XML file from Wordpress, I get this error:
The website encountered an unexpected error.  Please try again later. 

When I checked the error messages pages I found this:

Drupal\Core\Database\ConnectionNotDefinedException: The specified database connection is not defined: migrate in Drupal\Core\Database\Database::openConnection() (line 361 of /media/mosama/Content/test_poc/drupal8_2/core/lib/Drupal/Core/Database/Database.php). 

Any solution for this? 

A:

Solved! 
By adding anothe data base configuration with ['migrate'] in settings.php under the default database like this
$databases['migrate']['default'] = array (
  'database' => 'NAME',
  'username' => 'USER',
  'password' => 'PASS',
  'prefix' => '',
  'host' => 'localhost',
  'port' => '3306',
  'namespace' => 'Drupal\\Core\\Database\\Driver\\mysql',
  'driver' => 'mysql',
);

