"우분투 PostgreSQL 설치"의 두 판 사이의 차이

79번째 줄: 79번째 줄:
root@zetawiki:~#  
root@zetawiki:~#  
</source>
</source>
==IP대역 설정==


==같이 보기==
==같이 보기==

2016년 3월 23일 (수) 14:12 판

우분투 PostgreSQL 서버 설치
우분투 postgres 설치

1 확인

Copy
root@zetawiki:~# aptitude show postgresql | grep State
State: not installed

2 설치

Copy
root@zetawiki:~# apt-get install postgresql
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  libpq5 postgresql-9.3 postgresql-client-9.3 postgresql-client-common
  postgresql-common
Suggested packages:
  oidentd ident-server locales-all postgresql-doc-9.3
The following NEW packages will be installed:
  libpq5 postgresql postgresql-9.3 postgresql-client-9.3
  postgresql-client-common postgresql-common
0 upgraded, 6 newly installed, 0 to remove and 145 not upgraded.
Need to get 889 kB/3,685 kB of archives.
After this operation, 15.5 MB of additional disk space will be used.
Do you want to continue? [Y/n]
Copy
Get:1 http://us.archive.ubuntu.com/ubuntu/ trusty-updates/main libpq5 amd64 9.3.11-0ubuntu0.14.04 [80.6 kB]
Get:2 http://us.archive.ubuntu.com/ubuntu/ trusty-updates/main postgresql-client-common all 154ubuntu1 [25.4 kB]
... (생략)
Creating new cluster 9.3/main ...
  config /etc/postgresql/9.3/main
  data   /var/lib/postgresql/9.3/main
  locale en_US.UTF-8
  port   5432
update-alternatives: using /usr/share/postgresql/9.3/man/man1/postmaster.1.gz to provide /usr/share/man/man1/postmaster.1.gz (postmaster.1.gz) in auto mode
 * Starting PostgreSQL 9.3 database server                                                    [ OK ] 
Setting up postgresql (9.3+154ubuntu1) ...
Processing triggers for libc-bin (2.19-0ubuntu6.6) ...

3 확인 2

Copy
root@zetawiki:~# dpkg -l | grep postgres
ii  postgresql                            9.3+154ubuntu1                          all          object-relational SQL database (supported version)
ii  postgresql-9.3                        9.3.11-0ubuntu0.14.04                   amd64        object-relational SQL database, version 9.3 server
ii  postgresql-client-9.3                 9.3.11-0ubuntu0.14.04                   amd64        front-end programs for PostgreSQL 9.3
ii  postgresql-client-common              154ubuntu1                              all          manager for multiple PostgreSQL client versions
ii  postgresql-common                     154ubuntu1                              all          PostgreSQL database-cluster manager
Copy
root@zetawiki:~# cat /etc/passwd | grep postgres
postgres:x:111:121:PostgreSQL administrator,,,:/var/lib/postgresql:/bin/bash
→ PostgreSQL 관리자 계정 postgres가 생성되었음
Copy
root@zetawiki:~# /etc/init.d/postgresql status
9.3/main (port 5432): online
Copy
root@zetawiki:~# netstat -tnlp | grep postgres
tcp        0      0 127.0.0.1:5432          0.0.0.0:*               LISTEN      23680/postgres

4 패스워드 설정

  • postgres 계정의 패스워드 변경
Copy
root@zetawiki:~# sudo -u postgres psql template1
could not change directory to "/root": Permission denied
psql (9.3.11)
Type "help" for help.

template1=# 
template1=# ALTER USER postgres with encrypted password 'P@ssw0rd';
ALTER ROLE
template1=# \q
root@zetawiki:~#

5 같이 보기

6 참고 자료

  • 우분투 MySQL 설치
    이번에 처음 우분투를 설치하게 되었고 mysql을 설치하고자 합니다 덕분에 잘 따라하고 있었습니다만 netstat -ntlp | grep mysqld (not all processes could be identified, non-owned process info will not Qweqwe750
  • 우분투 MySQL 설치
    명령어를 실행한 계정이 root가 아닌 것 같군요. 아래와 같이 sudo를 붙여서 실행해보세요. sudo netstat -ntlp | grep mysqld "ERROR 1045 (28000): Access denied for user"는 아이디, 패스워드 확인 후에 아래와 같이 J Jmnote