ようこそ ゲスト さん、新規登録(無料)して気になる疑問を解決しませんか?

質問

QNo.3133713 PostgreSqlインストールで
質問者:OLAPkun Linux環境にPostgreSqlをインストールしたいのですが以下のエラーがでて困ってます;

手順としては
1, ./configure
2, gmake
3, su
4, gmake install
5, mkdir /usr/local/pgsql/data
6, chown postgres /usr/local/pgsql/data
7, su - postgres
8, /usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data
9, /usr/local/pgsql/bin/postgres -D /usr/local/pgsql/data >logfile 2>&1 &
10, /usr/local/pgsql/bin/createdb test
11, /usr/local/pgsql/bin/psql test

まず手順8で以下のエラーが出ます
database "postgres" does not exist

その後、手順9を実行すると以下のエラーがでます
createdb: could not connect to database template1: could not connect to server: そのようなファイルやディレクトリはありません
Is the server runnning locally and accepting
connections on Unix domain socket "/tmp/.s.PGSQL.5432"?

解決策等ご存知でしたら教えて頂けないでしょうか?
よろしくお願い致します。
困り度:
  • 困っています
質問投稿日時:
07/07/02 17:43

回答

ANo.1 事前にユーザpostgresを作成してから実行していますか?
一度、/usr/local/pgsql/data以下を全て削除してから、initdbし直してみて下さい。
ユーザpostgresで、データベースpostgresが生成できないと前に進みません。
回答者:TA-HT81S
種類:アドバイス
どんな人:専門家
自信:参考意見
回答日時:
07/07/02 19:06
この回答への補足この回答に補足をつける(質問者のみ)
この回答へのお礼この回答にお礼をつける(質問者のみ)