The following steps are commonly used to install postgressql in linux systems with the source type mentioned above.
- Download a postgresql*.tar.gz from a mirror listed here.
- Then from your download directory$ sudo mv postgresql*.tar.gz /usr/local/src $ cd /usr/local/src $ sudo tar -xzvf postgresql*.tar.gz
- Configure and install PostgreSQL:
Using configure, you can add/remove the features you want before install. This will change the installation source tree accordingly. If you are finding that some features are missing after complie you can reconfigure and continue the susequent steps to build and and install. If you choose to reconfigure the PostgreSQL source before you install, make sure you use the gmake clean command within the source tree. This will delete all object files and partially compiled files.
- Do user related stuff:create the postgres user,$ sudo adduser postgresMake a folder to store the Postgresql data. This folder can be created at anywhere and no restriction about that. After creating the folder owner of that folder should be made as 'postgres'.$ sudo mkdir /usr/local/pgsql/data$ sudo chown postgres /usr/local/pgsql/data
- Change to the postgres user and continue$ sudo su - postgres
- Initialize the data directory$ /usr/local/pgsql/bin/initdb -D /usr/local/pgsql/datacreate the log dir$ mkdir /usr/local/pgsql/data/log
- Sample to start the server$ /usr/local/pgsql/bin/postgres -D /usr/local/pgsql/data > /usr/local/pgsql/data/log/logfile 2>&1 &create a sample database$ /usr/local/pgsql/bin/createdb mysampledbNow test it$ /usr/local/pgsql/bin/psql mysampledb
$ cd /usr/local/src/postgres*
$ ./configure –with-libxml –without-readline –without-zlib –with-libraries=/usr/local/lib
$ makeIf you want to
$ sudo make install
Hopefully you’ll get a “PostgreSQL installation complete.”
No comments:
Post a Comment