Prerequisites:
Existing database entered in the settings.php file.
In this example:

$databases['mg_legacy']['default'] = array (
  'database' => 'mg_legacy',
  'username' => 'xxx',
  'password' => 'xxx',
  'host' => 'localhost',
  'port' => '3306',
  'driver' => 'mysql',
  'prefix' => '',
  'collation' => 'utf8mb4_general_ci',
);

Installation:
Enable module