加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

postgresql – 尝试创建数据库时出错 – Ecto – Phoenix

发布时间:2020-12-13 16:31:42 所属栏目:百科 来源:网络整理
导读:我在尝试创建数据库时遇到错误.我安装了postgres,我已经成功完成了一些测试项目.而且,我没有看到这个错误.任何帮助都会很棒: 错误: ~/Desktop/elixir/restore $mix ecto.create** (Mix) The database for Restore.Repo couldn't be created: tcp connect:
我在尝试创建数据库时遇到错误.我安装了postgres,我已经成功完成了一些测试项目.而且,我没有看到这个错误.任何帮助都会很棒:

错误:

~/Desktop/elixir/restore $mix ecto.create
** (Mix) The database for Restore.Repo couldn't be created: tcp connect: connection refused - :econnrefused

21:52:23.978 [error] GenServer #PID<0.150.0> terminating
** (Postgrex.Error) tcp connect: connection refused - :econnrefused
    (db_connection) lib/db_connection/connection.ex:148: DBConnection.Connection.connect/2
    (connection) lib/connection.ex:623: Connection.enter_connect/5
    (stdlib) proc_lib.erl:240: :proc_lib.init_p_do_apply/3
Last message: nil
State: Postgrex.Protocol
我尝试运行mix ecto.create时遇到了同样的问题.
所以首先要确保你有postgres.建议使用brew来安装它.

brew安装postgres

使用brew服务来启动/停止postgresql,

创建一个数据库,

创建postgres超级用户,

可能你需要授予文件夹权限.

这些链接对我有用:

psql: FATAL: role “postgres” does not exist

psql: FATAL: database “<user>” does not exist

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读