记录了postgreSQL数据库的完整的安装配置过程,以及postgreSQL的pgcli命令行智能提醒扩展,pgadmin3图形化管理客户端的配置安装。此postgresql是bigsql版安装详情,另bigsql刚出新版9.6 www.bigsql.org

1.环境前提

  • linux(ubuntu16.04)
  • postgresql-95
    在postgreSQL官网下载deb安装包

2.安装postgresql,使用dkpg命令进行安装

sudo dpkg -i /home/wxl/Downloads/postgresql-9.5.3-1-x64-bigsql.deb

3.配置并初始化postgreSQL 服务

3.1.开启服务

hwclock.sh              rc                     x11-common
wxl@wxl-pc:/etc/init.d$ sudo /etc/init.d/postgresql-95 start
PostgreSQL 9.5 Configuration
---------------------------------
This will initialize PostgreSQL database cluster. The following
questions will determine the database server port, superuser passwordand to start server on system boot. Press <ENTER> to accept defaults.Specify PostgreSQL server port [5432]:
Specify superuser password [password]:
Do you want PostgreSQL server to be started on boot (y/n) [y]: n
useradd: warning: the home directory already exists.
Not copying any file from skel directory into it.
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 localesCOLLATE:  en_US.UTF-8CTYPE:    en_US.UTF-8MESSAGES: en_US.UTF-8MONETARY: zh_CN.UTF-8NUMERIC:  zh_CN.UTF-8TIME:     zh_CN.UTF-8
The default text search configuration will be set to "english".Data page checksums are disabled.fixing permissions on existing directory /opt/postgresql/pg95/data ... ok
creating subdirectories ... ok
selecting default max_connections ... 100
selecting default shared_buffers ... 128MB
selecting dynamic shared memory implementation ... posix
creating configuration files ... ok
creating template1 database in /opt/postgresql/pg95/data/base/1 ... ok
initializing pg_authid ... ok
setting password ... ok
initializing dependencies ... ok
creating system views ... ok
loading system objects descriptions ... ok
creating collations ... ok
creating conversions ... ok
creating dictionaries ... ok
setting privileges on built-in objects ... ok
creating information schema ... ok
loading PL/pgSQL server-side language ... ok
vacuuming database template1 ... ok
copying template1 to template0 ... ok
copying template1 to postgres ... ok
syncing data to disk ... okSuccess. You can now start the database server using:/opt/postgresql/pg95/bin/pg_ctl -D /opt/postgresql/pg95/data -l logfile startStarting PostgreSQL 9.5:
waiting for server to start.... done
server started
PostgreSQL 9.5 started successfully
To load this postgres into your environment, source the env file:
. /opt/postgresql/pg95/pg95.env

3.2.配置系统变量,让postgreSQL环境变量生效

a.拷贝/opt/postgresql/pg95/pg95.env并重名为postgresql.sh,将postgreSQL.sh放置/etc/profile.d/下

wxl@wxl-pc: sudo cp /opt/postgresql/pg95/pg95.env /etc/profile.d/postgresql.sh

b.让变量生效

wxl@wxl-pc: source /etc/profile

3.3.进入postgresql 密码默认是password可以直接psql也可以psql -U postgres -d postgres进入sql

wxl@wxl-pc:~$ psql
Password:
psql (9.5.3)
Type "help" for help.postgres=# help
You are using psql, the command-line interface to PostgreSQL.
Type:  \copyright for distribution terms\h for help with SQL commands\? for help with psql commands\g or terminate with semicolon to execute query\q to quit
postgres=# \q

3.4.修改默认密码(默认用户名是 postgres,密码是 postgres)

ALTER USER postgres WITH PASSWORD 'newpassword';
wxl@wxl-pc:~$ psql -U postgres -d postgres
Password for user postgres:
psql (9.5.3)
Type "help" for help.postgres=# ALTER USER postgres WITH PASSWORD 'newpassword';
ALTER ROLE
postgres=# \q

4.安装图形界面

4.1.快速安装安装pgcli

a.安装pip

wxl@wxl-pc:~$ sudo apt install python-pip

b.通过pip快速安装pgcli

wxl@wxl-pc:~$ sudo pip install pgcli

c.如果!!如下报错,因为没有写入路径的权限,加sudo

wxl@wxl-pc:~$ pip install pgcli
Collecting pgcliUsing cached pgcli-1.1.0.tar.gz
Collecting pgspecial>=1.5.0 (from pgcli)Using cached pgspecial-1.5.0.tar.gz
Collecting click>=4.1 (from pgcli)Using cached click-6.6.tar.gz
Requirement already satisfied (use --upgrade to upgrade): Pygments>=2.0 in /usr/local/lib/python2.7/dist-packages (from pgcli)
Requirement already satisfied (use --upgrade to upgrade): prompt_toolkit<1.1.0,>=1.0.0 in /usr/local/lib/python2.7/dist-packages (from pgcli)
Collecting psycopg2>=2.5.4 (from pgcli)Using cached psycopg2-2.6.2.tar.gzComplete output from command python setup.py egg_info:running egg_infocreating pip-egg-info/psycopg2.egg-infowriting pip-egg-info/psycopg2.egg-info/PKG-INFOwriting top-level names to pip-egg-info/psycopg2.egg-info/top_level.txtwriting dependency_links to pip-egg-info/psycopg2.egg-info/dependency_links.txtwriting manifest file 'pip-egg-info/psycopg2.egg-info/SOURCES.txt'warning: manifest_maker: standard file '-c' not foundError: pg_config executable not found.Please add the directory containing pg_config to the PATHor specify the full executable path with the option:python setup.py build_ext --pg-config /path/to/pg_config build ...or with the pg_config option in 'setup.cfg'.----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-sD12wU/psycopg2/

4.2.验证postgreSQL安装是否正确,并查看pgcli版本

a.开启postgreSQL

#开启postgreSQL
sudo /etc/init.d/postgresql-95 start
#环境变量生效
wxl@wxl-pc:~$ . /opt/postgresql/pg95/pg95.env

b.查看pgcli版本

wxl@wxl-pc:~$ pgcli
Password:
Version: 1.1.0
Chat: https://gitter.im/dbcli/pgcli
Mail: https://groups.google.com/forum/#!forum/pgcli
Home: http://pgcli.com
postgres>

5.安装pgadmin3可视化数据库管理工具

5.1.pgadmin3安装

wxl@wxl-pc:~$ sudo install pgadmin3

5.2.pdadmin3链接postgresql

正确填写信息 name,host,password等信息

安装配置postgreSQL+pgcli+pgadmin3相关推荐

  1. Redhat、centos安装配置postgresql

    一.安装postgresql 本文仅以 redhat,postgresql9.4为例,使用yum方式进行介绍. 官网:http://www.postgresql.org/download/linux/ ...

  2. Debian8下安装配置PostgreSQL

    简介 PostgreSQL根据不同的操作系统,安装的方法也不同,这里采用的操作系统为: Debian GNU/Linux 8.2 (jessie) 如果是其他操作系统,请到PostgreSQL官方网站 ...

  3. Ubuntu Server 20.04 LTS 安装配置 PostgreSQL

    1 & 环境准备 上面一篇文章我们讲解了在 Windows 环境上面安装 PostgreSQL 的简单介绍,准备环境基本一样. ubuntu server 20.04 镜像下载地址 => ...

  4. PostgreSQL安装配置参考文档

    PostgreSQL安装配置参考文档 1.安装 Centos安装包链接 : https://yum.postgresql.org/rpmchart/ 然后选择系统版本及PostgreSQL版本 举例 ...

  5. PostgreSQL 安装配置 (亲测可用)

    转自:http://blog.csdn.net/jesseyoung/article/details/41348835 受作者博客限制,请访问上面的链接 ---------- 下面是另一个转载 --- ...

  6. linux安装php pgsql,Linux下apache php+phppgadmin+postgresql安装配置

    操作系统:CentOS 安装包:httpd(首选yum), php(包括php以及php-pgsql,php-mbstring,首选yum), phppgadmin , postgresql . 一. ...

  7. yum安装odbc驱动linux,在CentOS上离线配置PostgreSQL ODBC数据源

    一.问题提出 内网的一台CentOS服务器,需配置PostgreSQL ODBC.如果可以连接Internet,此工作很容易,使用yum install自动安装相应依赖包后简单配置即可.但当置于内网环 ...

  8. Windows上PostgreSQL安装配置教程

    这篇文章主要为大家详细介绍了Windows上PostgreSQL安装配置教程,具有一定的参考价值,感兴趣的小伙伴们可以参考一下 PostgreSQL的扩展PostGIS是最著名的开源GIS数据库.  ...

  9. postgresql 安装 配置远程访问 PostgreSQL WAL日志解析工具: wal2json cdc数据同步方案

    文章目录 一.安装postgres 二.WAL日志解析工具 三.cdc增量数据同步方案 一.安装postgres (1)新增postgres用户组: groupadd postgres 新增postg ...

最新文章

  1. 赠书 | 在Python领域,你与专家之间的距离只差这两本书
  2. ITTC数据挖掘平台介绍(四) 框架改进和新功能
  3. elasticsearch v6.5.4配置
  4. windows 获取当前进程/线程的ID、句柄和内核地址
  5. python读取中文txt文本-python读取中文txt文本的方法
  6. linux 常见服务端口
  7. java逻辑第九章_深入理解jvm-(第九章)类加载及执行子系统的案例与实战
  8. SAP系统中在发布了webservice,获得了WSDN地址后,外部系统怎么传数据到SAP?
  9. Cisco无线AP上联口为trunk时无法注册故障处理
  10. python日期函数_python 时间及日期函数
  11. HDU 3507 Print Article(斜率优化DP)
  12. c语言高中while题目,东风一中高中生智能机器人班c语言上机试题.doc
  13. Oracle修改表空间为自动扩展
  14. Launcher启动的流程图【AndroidICS4.0——Launcher系列四】
  15. Java——设计模式(装饰模式_IO)
  16. 改变ALERT组件的背景色和背景透明度.
  17. 离职原因之3B分类问题
  18. 做一个视频通话给自己用吧
  19. 如何将py文件转化为exe
  20. 刘润、陈果、董小英、朋新宇、付晓岩等50余位专家力荐《精益数据方法论》重磅上市!...

热门文章

  1. com.sun.crypto.provider.SunJCE
  2. 数据库中的数据类型和c#的数据类型的映射表[转]
  3. PESCMS Ticket 客服工单系统 v1.2.5 发布
  4. 软件设计师备考知识05--设计模式
  5. UICollectionView自定义布局(二)
  6. 【微信小程序】:实现轮播图3秒滚动
  7. J2EE的13种核心技术
  8. iOS开发关于block学习的总结
  9. AD恢复(2)使用授权还原
  10. Javascript实现复选框(全选反选功能)