3
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

PostgreSQL の初期化ができない場合

Last updated at Posted at 2020-12-11

本記事の内容

PostgreSQLの初期化をする際のエラーを共有し、初学者の方に役立てればと思い作成しました。

エラーコード

initdb: error: 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".

Data page checksums are disabled.

エラーコードの意味

ディレクトリ "/usr/local/var/postgres" は存在しますが、空ではありません。
新しいデータベースシステムを作成したい場合は
ディレクトリ"/usr/local/var/postgres "を指定するか、initdbを実行します。
に"/usr/local/var/postgres "以外の引数を指定してください。

解決方法

  • rm -rf /usr/local/var/postgresを実行.
  • initdb /usr/local/var/postgres -E utf8を実行。
Success. You can now start the database server using:
3
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?