postgresql install and configure for ubuntu
ABSTRACT
PostgreSQL is an object-relational database system that has the features of traditional commercial database systems with enhancements to be found in next-generation DBMS systems. This blog entry documents the installation process of the PostgreSQL database on Ubuntu Linux.
sudo apt-get install postgresql
sudo apt-get install libpq-dev
INTRODUCTION
I have selected PostgreSQL 9.1 and Ubuntu Linux 12.10 32 bit. The installation process follows the apt-get install configure
pattern.
STEP 1: VERIFY THAT YOU DO NOT ALREADY HAVE POSTGRESQL INSTALLED ON YOUR SYSTEM
Run the following command in your console:
1
|
ps ax | grep postgres
|
If you get a response similar to the one below, then you have PostgreSQL installed.
1
2
3
4
|
Ss 0:00 postgres: writer process Ss 0:00 postgres: wal writer process Ss 0:00 postgres: autovacuum launcher process Ss 0:00 postgres: stats collector process |
STEP 2: INSTALL POSTGRESQL ON YOUR SYSTEM
Run the following commands in your console:
1
2
|
sudo apt-get update
sudo apt-get install postgresql-9.1
|
STEP 3: CONFIGURE YOUR POSTGRESQL PASSWORD
1
2
3
|
sudo -u postgres psql template1
ALTER USER postgres with encrypted password 'your_password' ;
Press ctrl-d |
STEP 4: CONFIGURE MD5 AUTHENTICATION
1
|
sudo nano /etc/postgresql/9 .1 /main/pg_hba .conf
|
Update the
1
|
local all postgres
|
entry to
1
|
local all postgres md5
|
STEP 5: ENABLE TCP/IP CONNECTIONS
1
|
sudo nano /etc/postgresql/9 .1 /main/postgresql .conf
|
Locate the line
1
|
#listen_addresses = 'localhost' |
and change it to:
1
|
listen_addresses = 'localhost'
|
To allow other computers to connect to your PostgreSQL server replace ‘localhost’ with the IP Address of your server, or alternatively to ’0.0.0.0′ to bind to all interfaces.
STEP 6: RESTART POSTGRES
1
|
sudo service postgresql restart
|
STEP 7: CONGRATULATIONS! YOU HAVE SUCCESSIVELY INSTALLED POSTGRESQL ON UBUNTU
推荐阅读
-
Ubuntu install 错误 E:Unable to locate package
-
Ubuntu 执行 apt-get install ××× 报错
-
Ubuntu install docker
-
UBuntu中sudo gem install sqlite3 无法执行成功
-
postgresql install and configure for ubuntu
-
Ubuntu18.04 ROS填坑之 roscore Command ‘roscore‘ not found, ..... : sudo apt install python-roslaunch
-
ubuntu20.04 安装 配置 postgresql
-
ubuntu 安装 pg包和postgresql数据库
-
ubuntu 16.04 desktop + server LTS - pip3 install & uninstall
-
How to Install Grub Customizer in Ubuntu 16.04 LTS