If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > PostgreSQL > couldn't uderstand how to start postgres DB server !!

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-22-11, 19:00
sachinites sachinites is offline
Registered User
 
Join Date: May 2011
Location: mumbai
Posts: 6
couldn't uderstand how to start postgres DB server !!

i have installed postgres two days ago , since then i havent been able to even start the Database server despite having browse the whole internet , but all in vain .

when i start ubuntu , i login as 'abhishek' & pwd is "abhi" .

I read that , i have to create a new postgres user account "adduser " command . so i did :
sudo adduser postgres # (postgres is the name of account)
password : <gave the password as 'postgrespwd'>

then , i login as 'postgres' using command :
su postgres
password : 'postgrespwd'

then , usung 'initdb' , i initialsed the database cluser . Cluster got created successfully .
initdb -D data

then , when i get to start the DB server (as per the tutorials) , i typed the command :
./postgres -D data

but it says the error :
data has wrong ownership
HINT: The server must be started by the user that owns the data directory.

i saw that 'data' directory has the owner as root by looking into at its properties . Since i created the directory through initdb command after login into 'postgres' account , then why its owner is 'root' .

what should i do ??? please help, if you dont want me to switch back to Windows which i startd dislike after working on ubuntu !!

my whole attempt is here :

abhishek@ubuntu:/host/driveD/manualInstalls/SpatialDatabase/PostgreSQL_postGIS/installPostgreSQL/bin$ su postgres
Password:
postgres@ubuntu:/host/driveD/manualInstalls/SpatialDatabase/PostgreSQL_postGIS/installPostgreSQL/bin$ rm -r ./../mydata
postgres@ubuntu:/host/driveD/manualInstalls/SpatialDatabase/PostgreSQL_postGIS/installPostgreSQL/bin$ initdb -D ./../mydata
The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.

The database cluster will be initialized with locale en_US.UTF-8.
The default database encoding has accordingly been set to UTF8.
The default text search configuration will be set to "english".

creating directory ./../mydata ... ok
creating subdirectories ... ok
selecting default max_connections ... 100
selecting default shared_buffers ... 28MB
creating configuration files ... ok
creating template1 database in ./../mydata/base/1 ... ok
initializing pg_authid ... ok
initializing dependencies ... ok
creating system views ... ok
loading system objects' descriptions ... ok
creating conversions ... ok
creating dictionaries ... ok
setting privileges on built-in objects ... ok
creating information schema ... ok
loading PL/pgSQL server-side language ... ok
vacuuming database template1 ... ok
copying template1 to template0 ... ok
copying template1 to postgres ... ok

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

Success. You can now start the database server using:

postgres -D ./../mydata
or
pg_ctl -D ./../mydata -l logfile start

postgres@ubuntu:/host/driveD/manualInstalls/SpatialDatabase/PostgreSQL_postGIS/installPostgreSQL/bin$ pg_ctl -D ./../mydata startserver starting
postgres@ubuntu:/host/driveD/manualInstalls/SpatialDatabase/PostgreSQL_postGIS/installPostgreSQL/bin$ FATAL: data directory "/host/driveD/manualInstalls/SpatialDatabase/PostgreSQL_postGIS/installPostgreSQL/bin/./../mydata" has wrong ownership
HINT: The server must be started by the user that owns the data directory.

postgres@ubuntu:/host/driveD/manualInstalls/SpatialDatabase/PostgreSQL_postGIS/installPostgreSQL/bin$ chown -R postgres ./../mydata
postgres@ubuntu:/host/driveD/manualInstalls/SpatialDatabase/PostgreSQL_postGIS/installPostgreSQL/bin$ pg_ctl -D ./../mydata startserver starting
postgres@ubuntu:/host/driveD/manualInstalls/SpatialDatabase/PostgreSQL_postGIS/installPostgreSQL/bin$ FATAL: data directory "/host/driveD/manualInstalls/SpatialDatabase/PostgreSQL_postGIS/installPostgreSQL/bin/./../mydata" has wrong ownership
HINT: The server must be started by the user that owns the data directory.



please help !!
Reply With Quote
  #2 (permalink)  
Old 06-22-11, 23:26
futurity futurity is offline
Registered User
 
Join Date: May 2008
Posts: 270
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On