내가 가진 kryshah 정확히 같은 오류를 얻을 수 su - postgres및sudo -u postgres psql . DanielM의 대답은 오류도 제공합니다.
설정이 잘못되었을 때 출력
그러나 przbabu의 의견에서 대답하십시오.
masi$ psql
psql: FATAL: database "masi" does not exist
masi$ psql -U postgres
psql: FATAL: role "postgres" does not exist
masi$ psql postgres
psql (9.4.1)
Type "help" for help.
이 문제의 일부는 OSX의 소유자 설정에있을 수 있습니다.
masi$ ls -al /Users/
total 0
drwxr-xr-x 7 root admin 238 Jul 3 09:50 .
drwxr-xr-x 37 root wheel 1326 Jul 2 19:02 ..
-rw-r
drwxrwxrwt 7 root wheel 238 Apr 9 19:49 Shared
drwxr-xr-x 2 root admin 68 Jul 3 09:50 postgres
drwxr-xr-x+ 71 masi staff 2414 Jul 3 09:50 masi
하지만 일이 sudo chown -R postgres:staff /Users/postgres있습니다 chown: invalid user: ‘postgres:staff’.
요컨대 이것은 문제의 해결책이 아닙니다. postgres 설치에서 제공하는 도구를 사용하여 사용자 및 데이터베이스를 만듭니다.
올바른 설정 및 출력을 얻으려면
postgres 설치 후 데이터베이스 시스템에 새 사용자를 추가하는 특정 명령이 있습니다. initdb 후 여기에 설명 된대로 다음을 실행합니다.
createuser
createdb -Opostgres -Eutf8 masi_development
psql -U postgres -W masi_development
항상 비밀번호 요청을 방지하기 위해 여기에 설명 된 세 가지 선택 사항이 있습니다 .