Postgres CentOS 7: Data directory is not empty

2016年4月9日23:27:51 发表评论 7,378 views

If completely wiping & reinstalling a Postgres DB, when running initdb like:

service postgresql-9.5 initdb -E 'UTF8' --pgdata="/foo/bar/"

you can encounter this service error:

Data directory is not empty! [FAILED]

To fix it (and this is the nuclear option -- all db data is wiped!)

On Amazon Linux (2014-x):

rm -rf /var/lib/pgsql9/data

On CentOS (6.x)

rm -rf /var/lib/pgsql/9.5/data
  • 我的微信
  • 这是我的微信扫一扫
  • weinxin
  • 我的微信公众号
  • 我的微信公众号扫一扫
  • weinxin
0 0 投票数
文章评分
订阅评论
提醒
guest

0 评论
内联反馈
查看所有评论