在Cygwin中启用Postgresql [英] Enable Postgresql in Cygwin

查看:176
本文介绍了在Cygwin中启用Postgresql的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我安装了 Cygwin 与Perl和 Postgresql 软件包。

I installed Cygwin with Perl and Postgresql packages enabled.

然后键入:

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

然后输入:

net start cygserver(This starts the service)

接下来我需要在Cygwin中启用Postgresql我试过下面提到的命令:

Next i need to enable Postgresql in Cygwin, so i tried the commands mentioned below:

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 下。

The Postgresql initdb and pg_ctl executables are located under /usr/sbin.

我猜想 / usr / sbin 不在你的 PATH

我使用一个开始/停止脚本,它保存在 $ HOME / bin 调用 pg 。以下是提示

I use a start/stop script which I keep under $HOME/bin called pg. Here's the gist.

这篇关于在Cygwin中启用Postgresql的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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