{"action":"created","issue":{"url":"https://api.github.com/repos/hechoendrupal/drupal-console/issues/3778","repository_url":"https://api.github.com/repos/hechoendrupal/drupal-console","labels_url":"https://api.github.com/repos/hechoendrupal/drupal-console/issues/3778/labels{/name}","comments_url":"https://api.github.com/repos/hechoendrupal/drupal-console/issues/3778/comments","events_url":"https://api.github.com/repos/hechoendrupal/drupal-console/issues/3778/events","html_url":"https://github.com/hechoendrupal/drupal-console/issues/3778","id":296252715,"number":3778,"title":"[database:connect] No database key besides `default` is recognized","user":{"login":"illepic","id":295127,"avatar_url":"https://avatars2.githubusercontent.com/u/295127?v=4","gravatar_id":"","url":"https://api.github.com/users/illepic","html_url":"https://github.com/illepic","followers_url":"https://api.github.com/users/illepic/followers","following_url":"https://api.github.com/users/illepic/following{/other_user}","gists_url":"https://api.github.com/users/illepic/gists{/gist_id}","starred_url":"https://api.github.com/users/illepic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/illepic/subscriptions","organizations_url":"https://api.github.com/users/illepic/orgs","repos_url":"https://api.github.com/users/illepic/repos","events_url":"https://api.github.com/users/illepic/events{/privacy}","received_events_url":"https://api.github.com/users/illepic/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-02-12T02:36:38Z","updated_at":"2018-02-12T17:10:03Z","closed_at":null,"author_association":"NONE","body":"Running any `database:` command against any database key defined in `settings.php` **besides** `default` results in an error.\r\n\r\nFor instance, with a `settings.php` consisting of:\r\n\r\n```php\r\n$databases['default']['default'] = array (\r\n  'database' => 'downfall_d8',\r\n  'username' => 'root',\r\n  'password' => 'root',\r\n  'prefix' => '',\r\n  'host' => 'localhost',\r\n  'port' => '3306',\r\n  'namespace' => 'Drupal\\\\Core\\\\Database\\\\Driver\\\\mysql',\r\n  'driver' => 'mysql',\r\n);\r\n\r\n$databases['migrate']['default'] = [\r\n  'database' => 'migrate',\r\n  'username' => 'root',\r\n  'password' => 'root',\r\n  'host' => 'localhost',\r\n  'port' => '3306',\r\n  'namespace' => 'Drupal\\\\Core\\\\Database\\\\Driver\\\\mysql',\r\n  'driver' => 'mysql',\r\n  'prefix' => 'demo_',\r\n];\r\n```\r\n\r\nand then running:\r\n\r\n```bash\r\nvendor/bin/drupal database:connect migrate\r\n```\r\n\r\nresults in:\r\n\r\n```bash\r\n[ERROR] Database \"migrate\" connection info wasn't found\r\n```\r\n\r\nwhereas running:\r\n\r\n```bash\r\nvendor/bin/drupal database:connect default\r\n```\r\n\r\nresults in:\r\n\r\n```bash\r\nConnection: \"mysql -A --database=downfall_d8 --user=root --password=root --host=localhost --port=3306\"\r\n````\r\n\r\n## Details\r\n\r\n- I am using Drupal Console as installed locally by the [Drupal Composer project](https://github.com/drupal-composer/drupal-project).\r\n- The `migrate` database is currently empty. I am hoping to let `vendor/bin/drupal database:restore` do its thing and import a Drupal 6 sql dump into the `migrate` database\r\n- The `migrate` database entry was added to `settings.php` via the `vendor/bin/drupal database:add` command.\r\n\r\n## Versions\r\n- Drupal version: 8.4.4\r\n- Console version: 1.5.0\r\n- Console Launcher version: 1.5.0 (but Drupal Console is **only** installed locally to the project via composer)."},"comment":{"url":"https://api.github.com/repos/hechoendrupal/drupal-console/issues/comments/364992302","html_url":"https://github.com/hechoendrupal/drupal-console/issues/3778#issuecomment-364992302","issue_url":"https://api.github.com/repos/hechoendrupal/drupal-console/issues/3778","id":364992302,"user":{"login":"LOBsTerr","id":537500,"avatar_url":"https://avatars0.githubusercontent.com/u/537500?v=4","gravatar_id":"","url":"https://api.github.com/users/LOBsTerr","html_url":"https://github.com/LOBsTerr","followers_url":"https://api.github.com/users/LOBsTerr/followers","following_url":"https://api.github.com/users/LOBsTerr/following{/other_user}","gists_url":"https://api.github.com/users/LOBsTerr/gists{/gist_id}","starred_url":"https://api.github.com/users/LOBsTerr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LOBsTerr/subscriptions","organizations_url":"https://api.github.com/users/LOBsTerr/orgs","repos_url":"https://api.github.com/users/LOBsTerr/repos","events_url":"https://api.github.com/users/LOBsTerr/events{/privacy}","received_events_url":"https://api.github.com/users/LOBsTerr/received_events","type":"User","site_admin":false},"created_at":"2018-02-12T17:10:03Z","updated_at":"2018-02-12T17:10:03Z","author_association":"CONTRIBUTOR","body":"The problem is that connection can be establish based on **key** and **target**. So, get proper information we need to accept the **target** argument, which by default should have value \"default\".\r\n"}}
{"actor":{"display_login":"LOBsTerr"}}