Làm cách nào để biết máy chủ Postgresql của tôi có đang chạy hay không?Cách kiểm tra trạng thái máy chủ PostgreSQL Mac OS X
tôi nhận được tin nhắn này:
[~/dev/working/sw] sudo bundle exec rake db:migrate
rake aborted!
could not connect to server: Connection refused
Is the server running on host "localhost" and accepting
TCP/IP connections on port 5432?
Cập nhật:
> which postgres
/usr/local/bin/postgres
> pg_ctl -D /usr/local/bin/postgres -l /usr/local/bin/postgres/server.log start
pg_ctl: could not open PID file "/usr/local/bin/postgres/postmaster.pid": Not a directory
Cập nhật 2:
>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
Bạn cũng nên tìm kiếm nhiều phiên bản của postgres trên Mac OS/X. Nếu bạn đã cài đặt postgres qua homebrew thì bạn có thể gặp lỗi trên khi đường dẫn của bạn được thiết lập sai - tôi chỉ vô tình làm hỏng đường dẫn của mình và mọi thứ bắt đầu bằng cách cài đặt hệ thống postgres không hoạt động tốt cho đến khi tôi điều chỉnh đường dẫn đến sử dụng các brew cài đặt –