Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/elixir/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Postgresql 无法混合使用exto.create、role';博士后';不存在_Postgresql_Elixir_Phoenix Framework_Ecto - Fatal编程技术网

Postgresql 无法混合使用exto.create、role';博士后';不存在

Postgresql 无法混合使用exto.create、role';博士后';不存在,postgresql,elixir,phoenix-framework,ecto,Postgresql,Elixir,Phoenix Framework,Ecto,我尝试创建一个名为postgres的用户。我通过brew重新安装了postgres。我能用它运行 postgres-D/usr/local/var/postgres 当我运行mix EXTO.create时,仍然会出现以下错误: ~/code/blog_phoenix:.mix ecto.create ** (Mix) The database for BlogPhoenix.Repo couldn't be created, reason given: psql: FATAL: role "

我尝试创建一个名为postgres的用户。我通过brew重新安装了postgres。我能用它运行

postgres-D/usr/local/var/postgres

当我运行mix EXTO.create时,仍然会出现以下错误:

~/code/blog_phoenix:.mix ecto.create
** (Mix) The database for BlogPhoenix.Repo couldn't be created, reason given: psql: FATAL:  role "postgres" does not exist.
~/code/blog_phoenix:.

您的数据库安装似乎缺少角色
postgres

您应该尝试使用默认凭据进行连接,然后执行SQL语句来创建角色及其默认数据库

在控制台运行中:

$ psql
然后


这不是一个重复的问题,因为这是一个特定于Phoenix框架的问题。
CREATE USER postgres SUPERUSER;
CREATE DATABASE postgres WITH OWNER postgres;