[How to] Fix postgresql initdb data directory is not empty

Sometimes, it does happen that during the initialization of postgresql, we face the issue “data directory not empty”.

service postgresql initdb

 

Initialization of the database has to be done only once. If it is done, no need to do it again if the database start works. If not, you can fix this by deleting the directory /var/lib/pgsql/9.3/data. Once the directory is deleted, run service postgresql initdb again. This should initialize postgresql successfully.

Also, if service postgresql start fails, check for running instance of postgresql. Kill the postgresql process and run start again. This should fix this basic problem.

7 Responses to [How to] Fix postgresql initdb data directory is not empty

  1. Highly descriptive article, I enjoued that bit. Will there be a part 2?

  2. I take pride in my work and hobby, its clear hat you do with your informative blog
    post. I was fortunate to find it here. Thanks for posting this information and I Have
    saved the site so I can find my way back here!

  3. hello!,I really like your writing very a lot!

    share we keep up a correspondence more about
    your post on AOL? I need an expert on this space to solve my problem.
    May be that’s you! Having a look ahead to peer you.

  4. There’s certainly a lot to learn about this issue.

    I really like all of the points you made.

  5. It’s remarkable in favor of me to have a web site,
    which is useful designed for my knowledge. thanks admin

  6. Kristine says:

    I pay a quick visit day-to-day some sites and blogs to read articles or reviews,
    except this webpage presents feature based writing.

  7. Stormy says:

    hey there and thank you for your information – I have certainly picked up something new from right here.
    I did however expertise some technical points using this web
    site, as I experienced to reload the web site a lot of times previous to I could get it to load properly.
    I had been wondering if your web host is OK? Not that I’m complaining,
    but slow loading instances times will very frequently
    affect your placement in google and can damage your high-quality score if advertising and marketing with Adwords.

    Anyway I am adding this RSS to my email and could look out for much more of your respective exciting content.
    Ensure that you update this again soon..

Leave a Reply

Your email address will not be published. Required fields are marked *