Обсуждение: Help installing PGSQL 7.1 on Linux
Following the instruction at the top of the 'INSTALL' file, I have installed PostgreSQL. However, after creating the 'postgres' user and su[ing] to the postgres user account, according to the 'INSTALL' file, I have to initialized the data base, using the following command '/usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data' After doing so, I get a message that reads: "This database will be initialized with user name "postgres". This user will own all the data files and must also own the server process. mkdir: cannot create directory /usr/local/pgsql/data: Permission denied. initdb failed Removing temp file /tmp/initdb.224." Using the root account to do the installation, I have tried about three times to get the installation completed, but I have had the same problem all three. Does anyone know what could be happening? Thanks in advance ======================================= PostgreSQL Installation Instructions Short Version ./configure gmake gmake install adduser postgres su - postgres /usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data <<== PROBLEM IS HERE /usr/local/pgsql/bin/postmaster -D /usr/local/pgsql/data >logfile 2>&1 & /usr/local/pgsql/bin/createdb test /usr/local/pgsql/bin/psql test
A couple of thoughts: 1) Take a look at the permissions on /usr/local/pgsql/data and make sure that it exists and it is either owned by postgres or postgres has rw access. It looks like the initdb process is trying to create it without having the right permissions on the parent directories. If I were doing this, I think I'd create it in advance using root & then use chown to make postgres the owner. 2) When you su to postgres, do an "su - postgres" (the dash makes sure the you get a shell environment so the .profile gets read.) hope this helps! -Nick -------------------------------------------------------------------------- Nick Fankhauser nickf@ontko.com Phone 1.765.935.4283 Fax 1.765.962.9788 Ray Ontko & Co. Software Consulting Services http://www.ontko.com/ > -----Original Message----- > From: pgsql-general-owner@postgresql.org > [mailto:pgsql-general-owner@postgresql.org]On Behalf Of Mayan > Sent: Thursday, November 08, 2001 8:20 PM > To: pgsql-general@postgresql.org > Subject: [GENERAL] Help installing PGSQL 7.1 on Linux > > > Following the instruction at the top of the 'INSTALL' file, I have > installed PostgreSQL. However, after creating the 'postgres' user > and su[ing] to the postgres user account, according to the > 'INSTALL' file, I have to initialized the data base, using the > following command > > '/usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data' > > After doing so, I get a message that reads: > "This database will be initialized with user name "postgres". > This user will own all the data files and must also own the server > process. > mkdir: cannot create directory /usr/local/pgsql/data: Permission > denied. > initdb failed > Removing temp file /tmp/initdb.224." > > Using the root account to do the installation, I have tried > about three times to get the installation completed, but I have had > the same problem all three. > > Does anyone know what could be happening? > > Thanks in advance > > ======================================= > PostgreSQL Installation Instructions > > Short Version > > ./configure > gmake > gmake install > adduser postgres > su - postgres > /usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data <<== PROBLEM IS > HERE > /usr/local/pgsql/bin/postmaster -D /usr/local/pgsql/data >logfile 2>&1 & > > /usr/local/pgsql/bin/createdb test > /usr/local/pgsql/bin/psql test > > > > ---------------------------(end of broadcast)--------------------------- > TIP 2: you can get off all lists at once with the unregister command > (send "unregister YourEmailAddressHere" to majordomo@postgresql.org) >
Hi, Check the owner + group permissions of ../data -- it has to be owner and group postgres Tielman J de Villiers BondNet Pty Ltd -----Original Message----- From: Mayan [mailto:escalante@canada.com] Sent: Friday, November 09, 2001 3:20 AM To: pgsql-general@postgresql.org Subject: [GENERAL] Help installing PGSQL 7.1 on Linux Following the instruction at the top of the 'INSTALL' file, I have installed PostgreSQL. However, after creating the 'postgres' user and su[ing] to the postgres user account, according to the 'INSTALL' file, I have to initialized the data base, using the following command '/usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data' After doing so, I get a message that reads: "This database will be initialized with user name "postgres". This user will own all the data files and must also own the server process. mkdir: cannot create directory /usr/local/pgsql/data: Permission denied. initdb failed Removing temp file /tmp/initdb.224." Using the root account to do the installation, I have tried about three times to get the installation completed, but I have had the same problem all three. Does anyone know what could be happening? Thanks in advance ======================================= PostgreSQL Installation Instructions Short Version ./configure gmake gmake install adduser postgres su - postgres /usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data <<== PROBLEM IS HERE /usr/local/pgsql/bin/postmaster -D /usr/local/pgsql/data >logfile 2>&1 & /usr/local/pgsql/bin/createdb test /usr/local/pgsql/bin/psql test ---------------------------(end of broadcast)--------------------------- TIP 2: you can get off all lists at once with the unregister command (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 The file doc/src/sgml/installation.sgml has the new and improved directions, namely: ./configure gmake su gmake install adduser postgres mkdir /usr/local/pgsql/data chown postgres /usr/local/pgsql/data su - postgres /usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data /usr/local/pgsql/bin/postmaster -D /usr/local/pgsql/data >logfile 2>&1 & /usr/local/pgsql/bin/createdb test /usr/local/pgsql/bin/psql test (note the all-important 'chown' line) It looks as if this has not made it's way into the top-level INSTALL file. Maybe somebody could remedy that? (and the online docs too?) Greg Sabino Mullane greg@turnstep.com PGP Key: 0x14964AC8 200111091249 -----BEGIN PGP SIGNATURE----- Comment: http://www.turnstep.com/pgp.html iQA/AwUBO+wXwrybkGcUlkrIEQJ4egCfeLDfvM/zcgx/Lg7hJoc8l1LwIvMAoKQF nj3ZUW4ykvdOxDbTw2DB03Ud =5TI/ -----END PGP SIGNATURE-----