我在安装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 initdb
和pg_ctl
可执行文件位于/usr/sbin
下。
我猜/usr/sbin
不在你的PATH
设置上。添加它应该会有效果。
我使用一个启动/停止脚本,我保持在$HOME/bin
下称为pg
。以下是要点: