{"action":"created","issue":{"url":"https://api.github.com/repos/elixir-lang/ecto/issues/1207","labels_url":"https://api.github.com/repos/elixir-lang/ecto/issues/1207/labels{/name}","comments_url":"https://api.github.com/repos/elixir-lang/ecto/issues/1207/comments","events_url":"https://api.github.com/repos/elixir-lang/ecto/issues/1207/events","html_url":"https://github.com/elixir-lang/ecto/issues/1207","id":127254358,"number":1207,"title":"Unable to run `mix ecto.create` without password, but `mix ecto.migrate` works","user":{"login":"Frost","id":2308,"avatar_url":"https://avatars.githubusercontent.com/u/2308?v=3","gravatar_id":"","url":"https://api.github.com/users/Frost","html_url":"https://github.com/Frost","followers_url":"https://api.github.com/users/Frost/followers","following_url":"https://api.github.com/users/Frost/following{/other_user}","gists_url":"https://api.github.com/users/Frost/gists{/gist_id}","starred_url":"https://api.github.com/users/Frost/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Frost/subscriptions","organizations_url":"https://api.github.com/users/Frost/orgs","repos_url":"https://api.github.com/users/Frost/repos","events_url":"https://api.github.com/users/Frost/events{/privacy}","received_events_url":"https://api.github.com/users/Frost/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-01-18T15:51:45Z","updated_at":"2016-01-18T16:01:13Z","closed_at":"2016-01-18T16:01:13Z","body":"I am running postgresql locally, and I allow my user to pretty much do everything with any local database, out of convenience.\r\n\r\nThe command line `psql` command automatically picks up my username, and tries to connect using that, and I would expect ecto to do the same if I don't provide one.\r\n\r\nHowever, this does not seem to be the case.\r\n\r\nRunning `mix ecto.create` results in the following error:\r\n\r\n    ** (Mix) The database for Phoenixtest.Repo couldn't be created, reason given: psql: fe_sendauth: no password supplied\r\n\r\nHowever, if I create the database myself, using `createdb my_app_dev`, then running `mix ecto.migrate` works fine.\r\n\r\nHow to reproduce this:\r\n\r\n* configure some user to have full access to your local postgresql\r\n* create a new phoenix project (for example `mix phoenix.new foo`)\r\n* remove the database credentials from a config file (e.g. config/dev.exs)\r\n* run `mix ecto.create` and watch it fail\r\n* run `createdb foo_dev`\r\n* run `mix ecto.migrate` and it will reply with `Already up`\r\n\r\nThis means I cannot run `mix test`, because that task recreates and migrates the database, which in turn means that I _have_ to have working database credentials, at least in my test config, if I ever want to be able to run `mix test`.\r\n\r\nI have tried digging around in the ecto source code, and I noticed that migrations and storage creation seem to be run in different parts of the code, but I couldn't manage to find where to change anything to allow this."},"comment":{"url":"https://api.github.com/repos/elixir-lang/ecto/issues/comments/172570064","html_url":"https://github.com/elixir-lang/ecto/issues/1207#issuecomment-172570064","issue_url":"https://api.github.com/repos/elixir-lang/ecto/issues/1207","id":172570064,"user":{"login":"Frost","id":2308,"avatar_url":"https://avatars.githubusercontent.com/u/2308?v=3","gravatar_id":"","url":"https://api.github.com/users/Frost","html_url":"https://github.com/Frost","followers_url":"https://api.github.com/users/Frost/followers","following_url":"https://api.github.com/users/Frost/following{/other_user}","gists_url":"https://api.github.com/users/Frost/gists{/gist_id}","starred_url":"https://api.github.com/users/Frost/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Frost/subscriptions","organizations_url":"https://api.github.com/users/Frost/orgs","repos_url":"https://api.github.com/users/Frost/repos","events_url":"https://api.github.com/users/Frost/events{/privacy}","received_events_url":"https://api.github.com/users/Frost/received_events","type":"User","site_admin":false},"created_at":"2016-01-18T16:01:13Z","updated_at":"2016-01-18T16:01:13Z","body":"Oh, nevermind.\r\n\r\nMy database config was apparently wrong.\r\n\r\nFor anyone else encountering this:\r\n\r\n* `host all my_user 127.0.0.1/32 trust`  will not work\r\n* `host all my_user localhost trust` *will* work"}}