PostgreSql“运行安装后步骤……数据库集群初始化失败" [英] PostgreSql "running post install step…the Database Cluster Initialisation failed"

查看:93
本文介绍了PostgreSql“运行安装后步骤……数据库集群初始化失败"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是 Windows 用户 - 我花了几个小时不断地安装和卸载,然后才开始工作,前 10 次左右看到标题中的错误消息.

I'm a Windows user - it took me a couple of hours of constant installs and uninstalls before I could get this working, with the first 10 or so times coming to see the error message in the title.

我把它放在这里作为一个自我回答的问题,以防止其他人在安装时遇到同样的问题,并为像我这样第一次使用 PostgreSql 的人提供一些基本的使用方法.

I place this here as a self-answered question to prevent others who might run into the same problem while installing, and include some basic usage methods for those like me who are first comers in using PostgreSql.

推荐答案

您必须手动运行存在的 initdb:"C:\Software\PostgreSql\12\bin"

You have to mannualy run initdb which is present : "C:\Software\PostgreSql\12\bin"

现在确保你关联postgres"自postgres"以来作为用户以及initdb cmd是在安装过程中创建的超级用户.

Now make sure u associate "postgres" as user alongwith the initdb cmd since "postgres" is the superuser that got created during installation.

initdb -D "D:\PostgreSql\12\data";-U postgres

initdb -D "D:\PostgreSql\12\data" -U postgres

现在,一旦数据库集群被初始化,您就可以使用 PostgreSql\12 的 bin 文件夹中的 pg_ctl 实用程序启动服务器

Now once database cluster is initialized then you can start the server by using pg_ctl utility present inside bin folder of PostgreSql\12

pg_ctl start -D "D:\PostgreSql\12\data"

pg_ctl start -D "D:\PostgreSql\12\data"

或者你也可以把它注册为windows服务,然后设置为自动

Or you can also register it as a windows service and you can set it to automatic

pg_ctl register -N PostgreSql-12.3.1 -D "D:\PostgreSql\12\data"

pg_ctl register -N PostgreSql-12.3.1 -D "D:\PostgreSql\12\data"

现在您已准备好使用 postgresql 数据库.通过 cmd 行 (psql) 或 pgAdmin4

Now you are all set to use the postgresql database. Either use it through cmd line (psql) or pgAdmin4

这篇关于PostgreSql“运行安装后步骤……数据库集群初始化失败"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆