In this guide, you will learn how to install PostgreSQL 11 and PgAdmin4 on Ubuntu 18.04 LTS.

在本指南中,您将学习如何在Ubuntu 18.04 LTS上安装PostgreSQL 11和PgAdmin4 。

PostgreSQL (PostgreSQL)

PostgreSQL is a free and open source cross-platform Relational Database Management System (RDBMS). It is widely used by developers in the development environment and in production environments as well. PostgreSQL 11 was released in November 2018 and comes with a wealth of new and exciting features.

PostgreSQL是一个免费的开源跨平台关系数据库管理系统(RDBMS)。 开发人员在开发环境和生产环境中也广泛使用它。 PostgreSQL 11于2018年11月发布,具有许多令人兴奋的新功能。

管理员 (PgAdmin)

PgAdmin 4 is a free and open source web-based administration and development platform that helps users to administer, manage and monitor Postgres databases in a graphical manner. Let’s now dive in and see how we can install the two.

PgAdmin 4是一个免费的开源基于Web的管理和开发平台,可帮助用户以图形方式管理,管理和监视Postgres数据库。 现在,让我们深入了解如何安装两者。

在Ubuntu上安装PostgreSQL (Install PostgreSQL on Ubuntu)

步骤1:导入GPG密钥并添加PostgreSQL APT存储库 (Step 1: Importing GPG key & adding PostgreSQL APT repository)

To get started, begin by importing the GPG key for the PostgreSQL packages. Use the command below to download the CA certificates.

首先,请导入PostgreSQL软件包的GPG密钥。 使用下面的命令下载CA证书。

$ sudo apt install wget ca-certificates

Sample Output

样本输出

Next, run the command below to import the GPG key to your system.

接下来,运行以下命令以将GPG密钥导入您的系统。

$ wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -

Output

输出量

步骤2:将PostgreSQL apt存储库添加到系统 (Step 2: Adding PostgreSQL apt repository to System)

Once done with importing the GPG key, append the PostgreSQL apt repository on your system.

导入GPG密钥后,将PostgreSQL apt存储库追加到您的系统上。

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

步骤3:在Ubuntu上安装PostgreSQL 11 (Step 3: Installing PostgreSQL 11 on Ubuntu)

Before installing PostgreSQL 11, first, update the system repositories as shown.

在安装PostgreSQL 11之前,首先,如图所示更新系统存储库。

$ sudo apt-get update

Next, run this command to install PostgreSQL 11.

接下来,运行此命令以安装PostgreSQL 11。

$ sudo apt-get install postgresql postgresql-contrib

Output

输出量

步骤4:连接到PostgreSQL 11 (Step 4: Connecting to PostgreSQL 11)

By default, PostgreSQL database server creates a user ‘postgres‘ having the role ‘postgres‘.

默认情况下,PostgreSQL数据库服务器创建一个用户Postgres的具有作用“Postgres的。

To connect to the PostgreSQL 11 server, log in to your system and run the command below to change to the postgres user.

要连接到PostgreSQL 11服务器,请登录到系统并运行以下命令以更改为postgres用户。

$ sudo su - postgres

NOTE: The ‘postgres’ user’s password is disabled by default.

注意:默认情况下,禁用“ postgres”用户的密码。

Finally , to connect to the PostgreSQL 11 database server use the psql command as shown.

最后,使用psql命令连接到PostgreSQL 11数据库服务器。

psql

Output

输出量

To check login information, run the command below.

要检查登录信息,请运行以下命令。

postgres-# \conninfo

Output

输出量

安装PgAdmin4 (Installation of PgAdmin4)

To begin the installation of PgAdmin4, run the command below.

要开始安装PgAdmin4,请运行以下命令。

$ sudo apt-get install pgadmin4 pgadmin4-apache2

Output

输出量

During the installation process, you will be prompted for an email address as shown below. This is the email address you will use to log in to the PgAdmin4 interface.
Provide an email address of your choice

在安装过程中,系统将提示您输入电子邮件地址,如下所示。 这是您用于登录PgAdmin4界面的电子邮件地址。
提供您选择的电子邮件地址

Next, you will be prompted for your password. Provide your preferred password. The system will then proceed to wrap up the installation of PgAdmin4.

接下来,将提示您输入密码。 提供您的首选密码。 然后,系统将继续包装PgAdmin4的安装。

Great ! At this point you have successfully installed PgAdmin4.

太好了! 至此,您已经成功安装了PgAdmin4。

连接到PgAdmin4 (Connecting to PgAdmin4)

Now that we have successfully installed PgAdmin4, it’s time now to connect to it. Open your browser and browse your server’s IP address as shown

现在我们已经成功安装了PgAdmin4,现在该连接它了。 如图所示,打开浏览器并浏览服务器的IP地址。

https://IP-address/pgAdmin4

In our example, the URL is:

在我们的示例中,URL为:

https://38.76.11.34/pgAdmin4

You will see the following login page. Enter the email address and password that you provided during the setup of PgAdmin4 and hit ‘Login’.

您将看到以下登录页面。 输入您在设置PgAdmin4期间提供的电子邮件地址和密码,然后单击“登录”。

You will finally be presented with the PgAdmin4 dashboard as shown below.

最终,您将看到PgAdmin4仪表板,如下所示。

With the dashboard, you can now create database server instances as well as monitor the performance of your databases.

使用仪表板,您现在可以创建数据库服务器实例以及监视数据库的性能。

This wraps up the topic of how to install PostgreSQL 11 and PgAdmin4 on Ubuntu server. Feel free to reach out to us with your feedback and share the article on your social platforms.

总结了如何在Ubuntu服务器上安装PostgreSQL 11和PgAdmin4的主题。 请随时与我们联系,以提供您的反馈,并在您的社交平台上分享文章。

翻译自: https://www.journaldev.com/26285/install-postgresql-pgadmin4-ubuntu

在Ubuntu 18.04上安装PostgreSQL 11和PgAdmin4相关推荐

  1. 如何在Ubuntu 18.04上安装Django

    Django是一个免费的开源高级Python Web框架,旨在帮助开发人员构建安全,可扩展和可维护的Web应用程序. 根据您的需要,有不同的方法来安装Django.它可以使用pip在系统范围内安装或在 ...

  2. 在Ubuntu 18.04上安装和使用Tesseract 4

    量子指南 (QUANTRIUM GUIDES) Today, the extraction of information from scanned documents such as letters, ...

  3. 如何在Ubuntu 18.04上安装Elasticsearch Logstash Kibana(Elastic Stack)

    In this guide, you will learn to install Elastic stack on Ubuntu 18.04. Elastic stack, formerly know ...

  4. skype linux 安装,如何在Ubuntu 18.04上安装Skype

    Skype是世界上最流行的通信应用程序之一,它使您可以拨打免费的在线音频和视频电话,以及可负担得起的拨打全球移动电话和固定电话的国际电话. Skype不是开源应用程序,也不包含在Ubuntu存储库中. ...

  5. ubuntu memcached php,如何在 Ubuntu 18.04 上安装 Memcached

    Memcached 是一个免费的开源高性能内存中键值数据存储. 它最常用于通过从数据库调用的结果缓存各种对象来加速应用程序. 在本教程中,我们将介绍在 Ubuntu 18.04 上安装和配置最新版 M ...

  6. ubuntu19 安装git_在Ubuntu 18.04上安装Git

    步骤1.首先,通过运行以下命令确保您的系统和apt包列表完全更新: apt-get update -y apt-get upgrade -y 第2步.在Ubuntu 18.04上安装Git. 现在让我 ...

  7. ubuntu18.04安装python3_如何在 Ubuntu 18.04上安装 Python3.7

    Python 是世界上最流行的编程语言之一,凭借其简单易学的语法,Python是初学者和经验丰富的开发人员的绝佳选择.随着近几年人工智能和大数据的火热,Python流行度更是进一步飙升,有冲顶编程语言 ...

  8. webmin安装_如何在Ubuntu 18.04上安装Webmin

    webmin安装 Are you averse to running commands on a terminal and instead prefer managing your Linux sys ...

  9. 如何在Ubuntu 18.04上安装/卸载NodeJS

    NodeJS is a JavaScript framework that allows you to build fast network applications with ease. In th ...

最新文章

  1. 虚拟化--015 配置VMware View Event database失败:
  2. ArcGIS Server 9.2 on Solaris/Linux 安装可能出现的问题
  3. Wannafly挑战赛22 B 字符路径 ( 拓扑排序+dp )
  4. linux 二级域名设置
  5. table中加表单元素怎么验证_045、DOM编程实例和表单
  6. 解决dev控件版本过期问题
  7. OFFICE使用技术:让几个自选图形间距相等
  8. 计算机板卡设计仿真,电子技能训练(1-1)201492.ppt
  9. mysql sql多个like性能_一个sql很多个not like的简化语句
  10. linux 达梦 tcp tcpv6,linux下配置ipv6地址
  11. quartus支持linux系统,Quartus 10 for Linux 安装
  12. java cnzz_cnzz 模拟请求登录(传入url get data ) demo
  13. 居家第二十五天朋友的豆芽菜
  14. matlab 判断鼠标按下_如何让MATLAB控制你的鼠标和键盘
  15. 为什么要数据归一化和归一化方法
  16. javaweb——jsp(jsp的本质是什么、jsp九大内置对象、四个域对象、jsp的主要作用)
  17. [附源码]Python计算机毕业设计大学生健康管理系统的设计与实现
  18. CONVERT转换函数
  19. TOC瓶颈管理理论/约束理论
  20. 计算机组装有哪些,电脑组装的配件有哪些

热门文章

  1. 一步步学习SPD2010--第二章节--处理SP网站(9)---- 关键点
  2. jquery的extend和fn.extend
  3. [WPF自定义控件库]自定义Expander
  4. 9月我的第一次,新的感悟
  5. React 入门与实战-课时7 虚拟DOM的本质和目的
  6. goolge hacks
  7. IP通信基础 3.21
  8. NOIP2017 Day1 T1 小凯的疑惑
  9. SQLServer生成带数据的脚本
  10. [Project Euler] Problem 26