8

I'm on Windows 10. I downloaded the most recent version of Psql.

I was like:

C:\Program Files\PostgreSQL\9.6\bin>initdb.exe "C:\psql_db"
The files belonging to this database system will be owned by user "Sean".
This user must also own the server process.

The database cluster will be initialized with locale "English_United States.1252".
The default database encoding has accordingly been set to "WIN1252".
The default text search configuration will be set to "english".

Data page checksums are disabled.

creating directory C:/psql_db ... ok
creating subdirectories ... ok
selecting default max_connections ... 100
selecting default shared_buffers ... 128MB
selecting dynamic shared memory implementation ... windows
creating configuration files ... ok
running bootstrap script ... ok
performing post-bootstrap initialization ... ok
syncing data to disk ... ok

WARNING: enabling "trust" authentication for local connections
You can change this by editing pg_hba.conf or using the option -A, or
--auth-local and --auth-host, the next time you run initdb.

Success. You can now start the database server using:

    "pg_ctl" -D "C:\psql_db" -l logfile start
C:\Program Files\PostgreSQL\9.6\bin>"pg_ctl" -D "C:\psql_db" -l logfile start

And it was like:

server starting

Access is denied.

4
  • 1
    Did you find the answer? Commented Sep 22, 2016 at 0:32
  • @Sean Reddy, did you find the solution? Commented Feb 6, 2017 at 10:11
  • Any solutions to this? Commented Apr 21, 2017 at 8:12
  • @YashGoenka yes Commented Sep 21, 2017 at 14:05

2 Answers 2

14

I think you are trying to create the logfile inside C:\Program Files\PostgreSQL\9.6\bin, for which you don't have write permission

Specify something like "pg_ctl" -D "C:\psql_db" -l "c:\users\joe\logfile" start

Sign up to request clarification or add additional context in comments.

1 Comment

this solution is woking. Thanks a lot. Better keep the log file outside of your PostgreSQL install folder.
2

This is because of windows file permissions. You can put the data folder on desktop "c:\Users\\Desktop\" instead of "C:\psql_db". Or maybe give your user more permissions.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.