{"action":"created","issue":{"url":"https://api.github.com/repos/magento/magento2/issues/1740","repository_url":"https://api.github.com/repos/magento/magento2","labels_url":"https://api.github.com/repos/magento/magento2/issues/1740/labels{/name}","comments_url":"https://api.github.com/repos/magento/magento2/issues/1740/comments","events_url":"https://api.github.com/repos/magento/magento2/issues/1740/events","html_url":"https://github.com/magento/magento2/issues/1740","id":103020247,"number":1740,"title":" Unknown database 'magento' when try to upgrade DB using bin/magento setup:upgrade command","user":{"login":"DRAJI","id":7078174,"avatar_url":"https://avatars.githubusercontent.com/u/7078174?v=3","gravatar_id":"","url":"https://api.github.com/users/DRAJI","html_url":"https://github.com/DRAJI","followers_url":"https://api.github.com/users/DRAJI/followers","following_url":"https://api.github.com/users/DRAJI/following{/other_user}","gists_url":"https://api.github.com/users/DRAJI/gists{/gist_id}","starred_url":"https://api.github.com/users/DRAJI/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DRAJI/subscriptions","organizations_url":"https://api.github.com/users/DRAJI/orgs","repos_url":"https://api.github.com/users/DRAJI/repos","events_url":"https://api.github.com/users/DRAJI/events{/privacy}","received_events_url":"https://api.github.com/users/DRAJI/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/magento/magento2/labels/PS","name":"PS","color":"fad8c7"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":23,"created_at":"2015-08-25T13:18:47Z","updated_at":"2016-05-09T09:23:14Z","closed_at":"2015-10-07T22:35:47Z","body":"I have created one simple (Helloworld module) module, After installed, when i run frontend, I got an error like below\r\n\r\na:4:{i:0;s:273:\"Please upgrade your database: Run \"bin/magento setup:upgrade\" from the Magento root directory. \r\nThe following modules are outdated:\r\nGmi_HelloWorld schema: current version - none, required version - 0.0.1\r\nGmi_HelloWorld data: current version - none, required version - 0.0.1\";i:1;s:1015:\"#0 [internal function]: Magento\\Framework\\Module\\Plugin\\DbStatusValidator->aroundDispatch(Object(Magento\\Framework\\App\\FrontController\\Interceptor), Object(Closure), Object(Magento\\Framework\\App\\Request\\Http))\r\n#1 /opt/lampp/htdocs/projects/magento2/lib/internal/Magento/Framework/Interception/Interceptor.php(141): call_user_func_array(Array, Array)\r\n#2 /opt/lampp/htdocs/projects/magento2/var/generation/Magento/Framework/App/FrontController/Interceptor.php(26): Magento\\Framework\\App\\FrontController\\Interceptor->___callPlugins('dispatch', Array, Array)\r\n#3 /opt/lampp/htdocs/projects/magento2/lib/internal/Magento/Framework/App/Http.php(115): Magento\\Framework\\App\\FrontController\\Interceptor->dispatch(Object(Magento\\Framework\\App\\Request\\Http))\r\n#4 /opt/lampp/htdocs/projects/magento2/lib/internal/Magento/Framework/App/Bootstrap.php(257): Magento\\Framework\\App\\Http->launch()\r\n#5 /opt/lampp/htdocs/projects/magento2/index.php(39): Magento\\Framework\\App\\Bootstrap->run(Object(Magento\\Framework\\App\\Http))\r\n#6 {main}\";s:3:\"url\";s:25:\"/projects/magento2/admin/\";s:11:\"script_name\";s:28:\"/projects/magento2/index.php\";}\r\n\r\nBut when i run \"bin/magento setup:upgrade\" this command via terminal, got following error in terminal\r\n\r\nCache cleared successfully\r\nFile system cleanup:\r\n/opt/lampp/htdocs/projects/magento2/var/generation/Magento\r\nUpdating modules:                                                         \r\n  [Zend_Db_Adapter_Exception]                               \r\n  SQLSTATE[42000] [1049] Unknown database 'magento'  \r\n                                                        \r\n  [PDOException]                                            \r\n  SQLSTATE[42000] [1049] Unknown database 'magento'  \r\n                                                            \r\nsetup:upgrade [--magento-init-params=\"...\"]\r\n \r\n\r\nI have been using \"magento\" DB only,"},"comment":{"url":"https://api.github.com/repos/magento/magento2/issues/comments/217816647","html_url":"https://github.com/magento/magento2/issues/1740#issuecomment-217816647","issue_url":"https://api.github.com/repos/magento/magento2/issues/1740","id":217816647,"user":{"login":"SailendraShakyaEbp","id":18590718,"avatar_url":"https://avatars.githubusercontent.com/u/18590718?v=3","gravatar_id":"","url":"https://api.github.com/users/SailendraShakyaEbp","html_url":"https://github.com/SailendraShakyaEbp","followers_url":"https://api.github.com/users/SailendraShakyaEbp/followers","following_url":"https://api.github.com/users/SailendraShakyaEbp/following{/other_user}","gists_url":"https://api.github.com/users/SailendraShakyaEbp/gists{/gist_id}","starred_url":"https://api.github.com/users/SailendraShakyaEbp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SailendraShakyaEbp/subscriptions","organizations_url":"https://api.github.com/users/SailendraShakyaEbp/orgs","repos_url":"https://api.github.com/users/SailendraShakyaEbp/repos","events_url":"https://api.github.com/users/SailendraShakyaEbp/events{/privacy}","received_events_url":"https://api.github.com/users/SailendraShakyaEbp/received_events","type":"User","site_admin":false},"created_at":"2016-05-09T09:23:14Z","updated_at":"2016-05-09T09:23:14Z","body":"Hi Darji,\r\n\r\nHave you got the solution of your above problem? If not I have faced the same issue and figure out the issue. I am posting this, hoping it may help others.\r\n\r\nActually in my case the problem was the php system environment variable was not set.Go to system environment variable add your php location to path, in my case \";D:\\xampp\\php\".\r\n\r\nNow run the script given in the error message on your terminal to upgrade your module to database.\r\n\r\nHope, this helps. "}}