Friday, December 11, 2015

Install PostgreSQL on CentOS

I am lazy, and this is the quickest commands to install postgresql on CentOS.
1. Install postgresql(as root)
yum install postgresql-server postgresql-contrib
2. Init postgresql(as root)
service postgresql initdb
3. Start postgresql(as root)
service postgresql start

[root@v1 pgsql]# ps -ef|grep -i postgre
postgres 12310     1  5 18:34 ?        00:00:00 /usr/bin/postmaster -p 5432 -D /var/lib/pgsql/data
postgres 12312 12310  0 18:34 ?        00:00:00 postgres: logger process
postgres 12314 12310  0 18:34 ?        00:00:00 postgres: writer process
postgres 12315 12310  0 18:34 ?        00:00:00 postgres: wal writer process
postgres 12316 12310  0 18:34 ?        00:00:00 postgres: autovacuum launcher process
postgres 12317 12310  0 18:34 ?        00:00:00 postgres: stats collector process
root     12461 29082  0 18:34 pts/3    00:00:00 grep -i postgre
4. Create a test database(as postgres)
[root@v1 pgsql]# su - postgres
-bash-4.1$ psql
psql (8.4.20)
Type "help" for help.

postgres=# create database test;
CREATE DATABASE


No comments:

Post a Comment

Popular Posts