CentOS Installation PostgreSQL Database process

Source: Internet
Author: User
Tags create directory


1.1.1 Software Installation


1. set user groups and user levels



Postgresql cannot run as root and will run as a different identity, so the corresponding users and groups must be established.



(1) New Database user groups: Groupadd Database



(2) New Pgsql users belong to PostgreSQL user groups: useradd-g Database Pgsql



(3) Modify Pgsql User Password :p asswd Pgsql (Here the password is set to Postgres )



2. Operating System Information: CentOS 5 x86



3. Preparing the installation package, download PostgreSQL source code: http://www.postgresql.org/ftp/source and now it's updated to version 9.1beta, this installation uses 8.4.6



4. Upload the downloaded postgresql-8.4.6.tar.gz to the/pgsql directory.





5


  1. [Email protected] opt]$$ CD Pgsql
  2. [Email protected] opt]$ $tar-ZXVF postgresql-8.4.6.tar.gz
  3. [Email protected] opt]$ CD postgresql-8.4.6/
  4. [Email protected] postgresql-8.4.6]$./configure--prefix=/opt/postgresql
  5. [[email protected] postgresql-8.4.6] $make

  6. [[email protected] postgresql-8.4.6] $make Install





6. Error



[[email protected] postgresql-8.4.6]$ make install



Make-c Doc Install



MAKE[1]: Entering directory '/home/pgsql/pgsql/postgresql-8.4.6/doc '



Mkdir-p--/opt/postgresql/share/doc//html



Mkdir:cannot Create directory '/opt/postgresql ': Permission denied



MAKE[1]: * * * [installdirs] Error 1



MAKE[1]: Leaving directory '/home/pgsql/pgsql/postgresql-8.4.6/doc '



Make: * * * [install] Error 2



[[email protected] postgresql-8.4.6]$ make install



Make-c Doc Install



MAKE[1]: Entering directory '/home/pgsql/pgsql/postgresql-8.4.6/doc '



Mkdir-p--/opt/postgresql/share/doc//html



Mkdir:cannot Create directory '/opt/postgresql ': Permission denied



MAKE[1]: * * * [installdirs] Error 1



MAKE[1]: Leaving directory '/home/pgsql/pgsql/postgresql-8.4.6/doc '



Make: * * * [install] Error 2



approach, change the opt to 777.



8. Initialize the database.


    1. [Email protected] postgresql-8.4.2]$ cd/opt/postgresql/bin/

    2. [Email protected] Bin]$./initdb--encoding=utf8-d/opt/postgresql/data


After initialization is complete, the screen prints the following information:



Success. You can now start the database server using:






./postgres-d/home/pgsql/data



Or



./pg_ctl-d/home/pgsql/data-l LogFile Start



10. Start the database





    1. [Email protected] bin]$./postgres-d/opt/postgresql/data


Of course, you can write the startup information to the log through the log rewrite, for example:


    1. [Email protected] bin]$/pg_ctl-d/opt/postgresql/data/-/home/pgsql/log/pg_server.log start


Log information is recorded in the file/home/pgsql/log/pg_server.log.



11. Installation is complete.






This article from the "Different Regions" blog, declined to reprint!



CentOS Installation PostgreSQL Database process


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.