在Cygwin中启用Postgresql



我在安装Cygwin时启用了Perl和Postgresql包。

然后输入:

 /usr/bin/cygserver-config (This will install the service)

然后输入:

net start cygserver(This starts the service)

接下来我需要在Cygwin中启用Postgresql,所以我尝试了下面提到的命令:

cygrunsrv -S cygserver
initdb -D /usr/share/postgresql/data
pg_ctl start -D /usr/share/postgresql/data -l /var/log/postgresql.log
createdb
psql

我得到一个错误:

$ initdb -D /usr/share/postgresql/data
-bash: initdb: command not found
$ pg_ctl start -D /usr/share/postgresql/data -l /var/log/postgresql.log
-bash: pg_ctl: command not found

谁能告诉我怎么做才对呢

Postgresql initdbpg_ctl可执行文件位于/usr/sbin下。

我猜/usr/sbin不在你的PATH设置上。添加它应该会有效果。

我使用一个启动/停止脚本,我保持在$HOME/bin下称为pg。以下是要点:

最新更新