-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
create database - mix ecto.create - error #1624
Comments
Looks like you ran the task from the |
[root@centos66a config]# cd /Users/me/work/elixir-stuff/hello_phoenix /var/lib/pgsql/9.5/data/pg_hba.conf TYPE DATABASE USER ADDRESS METHOD"local" is for Unix domain socket connections onlylocal all all peer IPv4 local connections:host all all 127.0.0.1/32 ident IPv6 local connections:host all all ::1/128 ident Allow replication connections from localhost, by a user with thereplication privilege.#local replication postgres peer |
Try this SO answer: Edit the file /etc/postgresql/8.4/main/pg_hba.conf and replace ident or peer by either md5 or trust, depending on whether you want it to ask for a password on your own computer or not. Then reload the configuration file with:
http://stackoverflow.com/a/7526119 If that doesn't work, please try the phoenix-talk mailing list where a well versed pg person may be able to help out. Thanks! |
I replaced ident by md5. TYPE DATABASE USER ADDRESS METHOD"local" is for Unix domain socket connections onlylocal all all peer IPv4 local connections:host all all 127.0.0.1/32 md5 IPv6 local connections:host all all ::1/128 md5 Allow replication connections from localhost, by a user with thereplication privilege.#local replication postgres peer but when I tried reload the configuration file I received message that Directory or File doesn't exist: [root@centos66a hello_phoenix]# /etc/init.d/postgresql reload Chris, where I can obtain the phoenix-talk mailing list ? |
Thanks Mjoen |
Answer here - https://stackoverflow.com/a/35497667/1882064 |
### Environment
### Expected behavior
$ mix ecto.create
The database for HelloPhoenix.Repo has been created.
### Actual behavior
//when I tried to create database, I received this error:
[root@centos66a hello_phoenix]# mix ecto.create
** (Mix) The database for HelloPhoenix.Repo couldn't be created, reason given: psql: FATAL: Ident authentication
failed for user "postgres"
//There is troublesooting that can fix this by creating the "postgres" role with the permissions needed to log in and
create a database.
=# CREATE ROLE postgres LOGIN CREATEDB;
CREATE ROLE
//but when I entered , I received this error:
postgres-# CREATE ROLE postgres LOGIN CREATEDB;
ERROR: syntax error at or near "su"
LINE 1: su - postgres
^
//but I found that postgres role already exist:
postgres-# pg_roles;
rolname
postgres
(1 row)
// after config/dev.exs set watchers to empty:
watchers: []
error changed:
[root@centos66a config]# mix ecto.create
** (Mix) The task "ecto.create" could not be found
The text was updated successfully, but these errors were encountered: