当前位置:网站首页>[install PG]
[install PG]
2022-07-24 20:59:00 【xyywendy】
linux install PG
There are three ways to install , The first binary installation package installation , The second way is through yum install , The third kind of . Compile and install through source code
Be careful :
1. The binary package includes the compiled , Programs that can run directly . By downloading and unpacking ( install ), After executing this instruction, you can use it immediately . Simple and quick , Suitable for relatively fixed , Procedures that do not need to be changed .
2. The source code package contains the original code of the program , It must be compiled on your computer , Generated executable binary files , To run . Some personal developed programs , The third-party modification or the program you want to modify should be compiled and installed through the source code package .
In fact, the first kind and the second kind can be divided into one kind , Here is a defect if the prompt has dependencies , You need to install dependencies .
Compile and install through source code
This installation method is relatively free , Installation can be minimized , It can also be fully installed .
Dependent packages before compilation , With RedHat/CentOS For example :
Minimum dependence :gcc,gcc-c++,zlib-devdl,readline-devel
Other dependence :perl-ExtUtils-Embed,pam-devel,libxslt-devel,openldap-devel,python-devel,openssl-devel,cmake
The installation of source code generally consists of three steps :
Download source package :https://www.postgresql.org/ftp/source/
# decompression tar.gz command
tar -xzvf file.tar.gz
Download the suffix .tar.gz My bag , You can also download the latest version . After decompression , use cd Command to this directory , Use ll perhaps ls You can see all the extensions below . Next, enter the three steps of installation .
- 1. To configure (configure)
configure Configuration instructions :./configure -help You can output a detailed list of options
Main options :
prefix: Specify installation path
with-openssl: Yes openssl Extended support
with-python: Yes python Extended support
with-perl: Yes perl Extended support
with-libxml: Yes xml Extended support
./configure --prefix=/usr/local/pg122 --with-pgport=1923 --with-openssl --with-perl --with-tcl --with-python --with-pam --without-ldap --with-libxslt --enable-thread-safty --with-wal-blocaksize=16 --with-blocksize=8 --enable-dtrace --enable-debug
./configure --prefix=/usr/local/pg141 --with-pgport=1923 -with-openssl --with-python --with-pam --with-libxml --with-libxslt --enable-tread-safety
Be careful :
–with-blocksize
If the database needs to be inserted frequently , The amount of data is growing very fast , Try to set this parameter larger ; Often do small data query , When updating and the memory is not very large, you can set it smaller . Default 8k that will do .
–enable-dtrace --enble-debug Do not add
- 2. compile (make)
gmake world -- Including all compilation of third-party plug-ins
gmake check-world -- This needs to be executed by ordinary users , Optional , Longer time consuming
Note that if the dependent dynamic library is missing , You need to install it in advance ,gmake world The installation includes documentation , be-all contirb
- 3. install (make install)
gmake install-world -- Including the installation of all third-party plug-ins
- 4. To configure
Create a normal user startup database , Super user cannot start database , If you use super user to start , Need to modify the source code , Yes root Some things detected by users , And modify its profile
useradd postgres
su - postgres
gedit/vim ~/.bashrc(bash_profile)
#add
export PGPORT=1923
export PG_HOME=/usr/local/pg122
export PATH=$PG_HOME/data
export LD_LIBRARY_PATH=$PG_HOME/lib
export LANG=en_US.utf8
# Save the document , Then activate
source ~/.bashrc
After the software is installed , To initialize
initialization (initdb)
- 1. Database cluster “cluster”, Is a file containing all the data 、 Profile's “data” Catalog
- 2. A physical server can have multiple cluster, adopt data Path and port Distinguish between port numbers .
- 3. Compile the installed database , need initdb Command to manually initialize the data Catalog , Common parameters are as follows :-D:data Path to directory -U: Database super user name -E: Configure regional language 、 Character set
initdb -D $PGDATA -E UTF8 --locale=C -U postgres -W
Pay attention to add -W The parameter will prompt for the password of the super user of the database , The password is blank by default
Modify the configuration file before starting the database
pg_hba.conf Used to configure the source of controlling access to the database
postgresql.conf Is the main configuration file of the database , You'd better adjust it, too linux Kernel parameters .
The installation is completed and ready to start the authentication service .
How to uninstall the compilation software installation
Compile and install how to uninstall : Three unloading methods
- 1. Remove installation directory : Check whether it is used when installing the software –prefix This command , If so, delete the file you specified ;
- 2. Execute the uninstall program : If it doesn't work –prefix This directory specifies , Enter the directory after software decompression , perform sudo make uninstall See if you can make it ;
- 3. Search and delete relevant directories : The last resort is to use whereis postgresql Locate the software installation directory ,rm -rf dir Delete these directories
边栏推荐
- Strong reference, weak reference, soft reference, virtual reference
- Experience of using dump file to reverse locate crash location
- Synthesis route of ALA PNA alanine modified PNA peptide nucleic acid | AC ala PNA
- Synthesis of peptide nucleic acid PNA labeled with heptachydrin dye cy7 cy7-pna
- Solution: 2003 cant connect to MySQL server on * * * * and use near 'identified by' * * * * 'with grant option' at
- Baidu interview question - judge whether a positive integer is to the power of K of 2
- Put apples
- Mitmproxy tampering with returned data
- Cloud native observability tracking technology in the eyes of Baidu engineers
- In the era of new knowledge economy, who is producing knowledge?
猜你喜欢

What should Ali pay attention to during the interview? Personal account of Alibaba interns who passed five rounds of interviews

Easy to use office network optimization tool onedns
![[training Day6] triangle [mathematics] [violence]](/img/57/d603886c202de7d46ea03487b633f5.png)
[training Day6] triangle [mathematics] [violence]

One bite of Stream(7)

Go language structure

Solution: 2003 cant connect to MySQL server on * * * * and use near 'identified by' * * * * 'with grant option' at
![[training Day10] tree [interval DP]](/img/2d/807cabc257f67fb708ed9588769de3.png)
[training Day10] tree [interval DP]

Fluoronisin peptide nucleic acid oligomer complex | regular active group alkyne, SH thiol alkynyl modified peptide nucleic acid

Synthesis of peptide nucleic acid PNA labeled with heptachydrin dye cy7 cy7-pna

Opencv learning Day2
随机推荐
[training Day6] dream [priority queue] [greed]
Eight transformation qualities that it leaders should possess
MySQL data recovery
[training Day8] series [matrix multiplication]
Top 10 in China's HCI software market: Huawei, Xinhua, Shenxin, VMware, Lenovo, smartx, Inspur, Qingyun, lutanli, dawn
How to buy Xinke financial products in CICC securities? Revenue 6%
Azide labeled PNA peptide nucleic acid | methylene blue labeled PNA peptide nucleic acid | tyrosine modified PNA | Tyr PNA Qiyue Bio
Lazily doing nucleic acid and making (forging health code) web pages: detained for 5 days
whistle ERR_ CERT_ AUTHORITY_ INVALID
Oracle 19C datagruad replication standby rman-05535 ora-01275
[training Day8] interesting number [digital DP]
[basic data mining technology] exploratory data analysis
Generate self signed certificate: generate certificate and secret key
[msp430g2553] graphical development notes (1) configuration environment
One bite of Stream(7)
[summary of Feature Engineering] explain what features are and the steps of feature engineering
Selenium uploads files in more ways than you think
Experience of using dump file to reverse locate crash location
What does software testing need to learn?
High soft course summary