PostgreSQL基础教程 > 在Ubuntu上安装PostgreSQL

在Ubuntu上安装PostgreSQL

视频录制中...

本节介绍一下如何在ubuntu上使用postgresql官方源 安装PostgreSQL

添加源

sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'

安装

sudo apt-get install wget ca-certificates -y
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo apt-get update
apt-get install postgresql-9.6 postgresql-server-dev-9.6

安装输出部分信息

/usr/lib/postgresql/9.6/bin/initdb -D /var/lib/postgresql/9.6/main --auth-local peer --auth-host md5
The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.

The database cluster will be initialized with locale "en_US.UTF-8".
The default database encoding has accordingly been set to "UTF8".
The default text search configuration will be set to "english".

Data page checksums are disabled.

fixing permissions on existing directory /var/lib/postgresql/9.6/main ... ok
creating subdirectories ... ok
selecting default max_connections ... 100
selecting default shared_buffers ... 128MB
selecting dynamic shared memory implementation ... posix
creating configuration files ... ok
running bootstrap script ... ok
performing post-bootstrap initialization ... ok
syncing data to disk ... ok

Success. You can now start the database server using:

    /usr/lib/postgresql/9.6/bin/pg_ctl -D /var/lib/postgresql/9.6/main -l logfile start

Ver Cluster Port Status Owner    Data directory               Log file
9.6 main    5432 down   postgres /var/lib/postgresql/9.6/main /var/log/postgresql/postgresql-9.6-main.log

其他软件的编译依赖

apt-get install libpq-dev

其他
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

参考

https://www.postgresql.org/download/linux/ubuntu/

更新时间: 2017年9月17日 03:25

Odoo应用开发交流一群 338127557 Odoo开发交流

评论留言

可对文章中不明白的地方进行提问,操作错误请截图,贴日志(帖截图和代码块功能稍后线上)或有更好的建议也可直接提出。

发表评论

close

    暂无评论