Final update:
我忘记了“<代码>initdb的指挥”。
指挥
ps auxwww | grep postgres
页: 1
> ps auxwww | grep postgres
remcat 1789 0.0 0.0 2434892 480 s000 R+ 11:28PM 0:00.00 grep postgres
问题在于:
我如何开始邮政局服务器?
最新情况:
> pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start
server starting
sh: /usr/local/var/postgres/server.log: No such file or directory
更新:
> mkdir /usr/local/var/postgres
> vi /usr/local/var/postgres/server.log
> ls /usr/local/var/postgres/
server.log
但是,当我试图在铁路服务器上启用Ruby,我仍然看到:
Is the server running on host "localhost" and accepting TCP/IP connections on port 5432?
更新:
> pg_ctl -D /usr/local/var/postgres status
pg_ctl: no server running
最新情况4:
我发现,<>wasn t any pg_hba.conf文档(只有文件pg_hba.conf.sample),因此我修改了样本并重新命名(删除了.sample)。 内容如下:
# IPv4 local connections:
host all all 127.0.0.1/32 trust
# IPv6 local connections:
host all all ::1/128 trust
但我不理解:
> pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start
server starting
> pg_ctl -D /usr/local/var/postgres status
pg_ctl: no server running
此外:
sudo find / -name postgresql.conf
find: /dev/fd/3: Not a directory
find: /dev/fd/4: Not a directory
更新5:
sudo pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start
Password:
pg_ctl: cannot be run as root
Please log in (using, e.g., "su") as the (unprivileged) user that will own the server process.
Update 6:
这似乎很奇怪:
> egrep listen|port /usr/local/var/postgres/postgresql.conf
egrep: /usr/local/var/postgres/postgresql.conf: No such file or directory
尽管我这样做了:
>sudo find / -name "*postgresql.conf*"
find: /dev/fd/3: Not a directory
find: /dev/fd/4: Not a directory
/usr/local/Cellar/postgresql/9.0.4/share/postgresql/postgresql.conf.sample
/usr/share/postgresql/postgresql.conf.sample
因此,我这样做:
egrep listen|port /usr/local/Cellar/postgresql/9.0.4/share/postgresql/postgresql.conf.sample
#listen_addresses = localhost # what IP address(es) to listen on;
#port = 5432 # (change requires restart)
# supported by the operating system:
# %r = remote host and port
因此,我试图这样做:
> cp /usr/local/Cellar/postgresql/9.0.4/share/postgresql/postgresql.conf.sample /usr/local/Cellar/postgresql/9.0.4/share/postgresql/postgresql.conf
> cp /usr/share/postgresql/postgresql.conf.sample /usr/share/postgresql/postgresql.conf
我仍在获得同样的“服务器运行吗?”信息。