Linux - Ubuntu
PostgreSQL 설치 및 접속
AJ Styles
2018. 2. 21. 14:33
1. https://www.postgresql.org/download/ 접속
2. 해당 리눅스 종류 및 버전 선택
ex) 우분투 16.04 버전의 경우, Xenial (16.04) 선택
3. 선택한 버전에 맞는 메뉴얼에 따라 설치
- Create the file /etc/apt/sources.list.d/pgdg.list, and add a line for the repository
deb http://apt.postgresql.org/pub/repos/apt/ xenial-pgdg main
- Import the repository signing key, and update the package lists
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | \
sudo apt-key add -
sudo apt-get update - postgresql-client-9.6 - client libraries and client binaries
- postgresql-9.6 - core database server
- postgresql-contrib-9.6 - additional supplied modules
- libpq-dev - libraries and headers for C language frontend development
- postgresql-server-dev-9.6 - libraries and headers for C language backend development
- pgadmin3 - pgAdmin III graphical administration utility
To use the apt repository, follow these steps:
For more information about the apt repository, including answers to frequent questions, please see the apt page on the wiki.
Included in distribution
Ubuntu includes PostgreSQL by default. To install PostgreSQL on Ubuntu, use the apt-get (or other apt-driving) command:
apt-get install postgresql-9.6
The repository contains many different packages including third party addons. The most common and important packages are (substitute the version number as required):
4. psql 접속
4-1. sudo su - postgres
4-2. psql