Install and configure postgreSQL in Red Hat 7.0

xiaoxiao2021-03-06  95

Installing and configuring postgresql2001-08-13 18:03 Wang Lin Song / (chinabyte) PostgreSQL initially developed a database management system developed by the University of California Berkeley Branch, which proposed many objects-relational database The concept is even better than many commercial databases today. It supports SQL92 / SQL3 language, transaction integrity, scalable types and other features. PostgreSQL is an open source of an open source based on the earlier code. PostgreSQL is a free Database Management System (DBMS) that is widely used in UNIX World, whether it supports features, or its performance and other commercial databases lower. Since it is written in C language, mutual transplant between different UNIXs is very convenient, so PostgreSQL can operate on numerous platforms, including: Solaris, AIX, SCO UNIX, HP UNIX, Linux, FreeBSD, etc. As the world's most widely used database system, POSTGRESQL is the world, and more and more people have begun to accept PostgreSQL. Now, the author introduces how to apply PostgreSQL on Redhat Linux 7.0. The author once read many books on installing and configuring PostgreSQL, paying attention to some problems in some operations. Now, the author introduces how to apply PostgreSQL on Redhat Linux 7.0. Your computer must meet the following conditions before installing and configuring PostgreSQL:

Red hat 7.0 has been installed. There is currently no postgreSQL installed. Gnome has been installed (I like gnome). Linuxconf has been installed. There is root privilege. The following covers the following include:

Install the PostgreSQL server and client. Postmaster configuration and option description. Create users and databases. Access the database from other computers. 1: Get PostgreSQL 1) Required files:

A postgreSQL-Server-7.0.2-17.i386.rpm

B PostgreSQL-7.0.2-17.i386.rpm

C PPP-PGSQL-4.0.1PL2-9.I386.rpm

2) Optional file:

A postgreSQL-Devel-7.0.2-17.i386.rpm

B PostgreSQL-JDBC-7.0.2-17.i386.rpm

C PostgreSQL-ODBC-7.0.2-17.i386.rpm

D PostgreSQL-Perl-7.0.2-17.i386.rpm

E posgreSQL-Python-7.0.2-17.i386.rpm

F PostgreSQL-TCL-7.0.2-17.i386.rpm (recommended installation)

G postegresql-tk-7.0.2-17.i386.2-17.0.2-17.i386.rpm part)

H phppgadmin_2-2-1-pl1.tar.gz (download address:

http://www.greatbridge.org/project/phppgadmin/projdisplay.php)

2: Install PostgreSQL

1) Install all .rpm files using GNORPM or command line RPM - IVH in the GNOME desktop environment.

2) According to your own situation, move the phppgamin file to a certain directory.

3) Use the command to extract in the directory of the phppgamin file: TAR - XZF phppgadmin_2-2-1-pl1.tar.gz.

Step 3: Postmaster's configuration and option Description Postmaster has a lot of configuration options, and the author will make a short description of the primary configuration options.

1) -b = Set the value of the shared memory disk buffer (must be at least twice the server process). 2) -d = Specify the database directory.

3) -n = Set the maximum value of the PostgRES server process.

4) -s = Start postmaster in still mode (no debugging information).

5) -d = commissioning level.

6) -i = Open the remote connection TCP / IP port.

7) -l = Enable SSL secure connection.

8) -O = The option to pass to the server process.

9) -p = Specify the open TCP / IP port by option -i.

3: Start PostgreSQL

1) Type: LinuxConf on the command line: Linuxconf.

2) Click the Control option.

3) Expand the Control Panel and click Control Service Activity.

4) Select PostgreSQL in the service list.

5) Click START.

6) If all progress is smooth, it should be able to start normally.

7) Turn off LinuxConf.

If you want to set up when the system is started, started PostgreSQL by default, the easiest way is to set it through the Setup tool. PostgreSQL After startup, enter / var / lib / pgsql / data, you will find a file called Postmaster.opts. This file briefly illustrates the options currently used by Postmaster, specifically displayed: / usr / bin / postmaster

-P 5432

-D / var / lib / pgsql / data

-B 64

-b / usr / bin / postgres

-i

-N 32

The author found that 32 server processes in the process of use are still not enough, so the author adds the server process to 128. At the same time, the buffer is also changed to 512, providing 4M buffer space. This requires editing this file file with / var / lib / pgsql / data. The changed configuration file should have such a paragraph: -b 512 -i -n 128 Back to step 4 Restart Postgres, then view the postmaster.opts file, it should be as follows: / usr / bin / postmaster

-P 5432

-D / var / lib / pgsql / data

-B 512

-b / usr / bin / postgres

-I

-N 128

If other problems do, I recommend not changing another option. 4: Allow remote computer connections

1) In the following example, the author will allow all computer users from 192.168.0.1 to access all databases.

2) In order to implement this, we only need to edit this file for pg_hba.conf.

3) pg_hba.conf under directory / var / lib / pgsql / data.

4) Open and edit the file, and finally add this line in the file:

Host All 192.168.0.1 255.255.255.0 For security considerations, the author strongly recommends setting permissions for all databases, setting the user if the user modifies the authority, and the most important thing is that you must clear whether there is a user with the largest authority, there is The right to create other users accessible to the entire PostgRES system. All in all, PostgreSQL installation and configuration is not difficult, mainly how users apply the PostgreSQL database. As for the application of the PostgreSQL database, please read the readers to refer to other professional books.

转载请注明原文地址:https://www.9cbs.com/read-105512.html

New Post(0)