Postgres를 시작할 수 없는 경우
1750 단어 PostgreSQLHomebrewtech
발생한 오류
$ psql
psql: error: could not connect to server: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
brew 서비스에서 다시 시작하기
$ brew services restart postgresql
Stopping `postgresql`... (might take a while)
==> Successfully stopped `postgresql` (label: homebrew.mxcl.postgresql)
==> Successfully started `postgresql` (label: homebrew.mxcl.postgresql)
$ psql
psql: error: could not connect to server: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
상태가 변하지 않습니다.Postgres를 시작합니다.
$ postgres -D /usr/local/var/postgres
2020-12-24 20:52:11.632 JST [15536] FATAL: lock file "postmaster.pid" already exists
2020-12-24 20:52:11.632 JST [15536] HINT: Is another postmaster (PID 406) running in data directory "/usr/local/var/postgres"?
lock file이 남아서 지워볼게요
$ rm /usr/local/var/postgres/postmaster.pid
brew 서비스에서 다시 시작하기
$ brew services restart postgresql
Stopping `postgresql`... (might take a while)
==> Successfully stopped `postgresql` (label: homebrew.mxcl.postgresql)
==> Successfully started `postgresql` (label: homebrew.mxcl.postgresql)
psql 연결
$ psql
psql (12.3)
Type "help" for help.
tetsuya=#
( ˘ω˘ )
Reference
이 문제에 관하여(Postgres를 시작할 수 없는 경우), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://zenn.dev/tetsuya/articles/d5e0aef6f7144f텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념 (Collection and Share based on the CC Protocol.)