如何在没有安装的情况下在windows中启动PostgreSQL和pgAdmin III。我在系统中没有管理员权限。因此,我需要在不安装的情况下启动应用程序。我该怎么做
-
从下载ZIP文件https://www.enterprisedb.com/products-services-training/pgbindownload
-
将归档文件解压到您选择的目录中(创建归档文件时,解压后,它将创建一个目录
pgsql,以及下面的所有内容) -
运行
initdb(可以在子目录pgsql\bin中找到)initdb-D c:\Users\Arthur\pgdata-U postgres-W-E UTF8-A scram-sha-256这将创建postgres";“数据目录”;(又名“集群”)在
c:\Users\Arthur\pgdata中。您需要确保运行此命令的用户对该目录具有完全读/写权限-U postgres将超级用户创建为postgres,-W将提示您输入超级用户的密码,-E UTF8将使用UTF-8编码创建数据库,-scram-sha-256启用密码验证 -
要启动Postgres,请运行:
pg\u ctl-D c:\Users\Arthur\pgdata-l日志文件启动此必须作为运行
initdb的用户执行(!),以避免访问数据目录时出现任何问题 -
要关闭Postgres,请运行:
pg\u ctl-D c:\Users\Arthur\pgdata stop -
psql.exe(命令行客户端)位于bin目录中。从Postgres 9.6开始,pgAdmin可执行文件pgAdmin4.exe位于子目录”中;pgAdmin 4\bin“ -
(可选)创建Windows服务以自动运行Postgres(必须使用Windows管理员帐户运行)
pg\u ctl寄存器-N postgresql-D c:\Users\Arthur\pgdata