現在下記の環境で作業をしております。
OS: OS X EI Caption
バージョン: 10.11.3
postgresqlの9.3が必要なため、下記のコマンドを実行しました。
brew install homebrew/versions/postgresql93
ln -sfv /usr/local/opt/postgresql93/*.plist ~/Library/LaunchAgents
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.postgresql93.plist
sudo chown -R ユーザー名 /usr/local/var/postgres
下記コマンド実行すると
postgres --version
ポスグレのバージョンが表示されるため、インストールは成功しています。
postgres (PostgreSQL) 9.3.9
しかし実際下記のコマンドを実行しようとすると
createuser -s -P postgres
下記のエラーが発生します。
createuser: could not connect to database postgres: 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"?
大変お手数おかけしますが、こちらのエラーの対処法教えてください。
**1/24 (23:40) 追記 **
そもそもPostgreSQLの初期化が上手くいかないようです。
下記コマンドを実行しました。
initdb /usr/local/var/postgres -E utf8 --no-locale
すると下記のように、おこられたので、
The files belonging to this database system will be owned by user "tam".
This user must also own the server process.
The database cluster will be initialized with locale "C".
The default text search configuration will be set to "english".
Data page checksums are disabled.
initdb: directory "/usr/local/var/postgres" exists but is not empty
If you want to create a new database system, either remove or empty
the directory "/usr/local/var/postgres" or run initdb
with an argument other than "/usr/local/var/postgres".
postgresのファルダを削除し、再度postgresを作成しようとすると
sudo rm -rf /usr/local/var/postgres
mkdir /usr/local/var/postgres
すると、postgresフォルダが勝手に作成されてうまくいかない状況です。
mkdir: /usr/local/var/postgres: File exists
こちらの原因が分かる方は、ぜひ教えてください。
回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2016/01/24 06:53