如何在 Windows 上下载和安装 PostgreSQL [17 个步骤]

要在您的机器上使用 Postgre,您需要安装

  1. Postgre 数据库服务器
  2. 用于管理和操作数据库的图形化工具。pgAdmin 是 Postgre 最受欢迎的 GUI 工具。

您可以单独为 Windows 下载 PostgreSQL 并安装这些组件,但数据库服务器和 GUI 工具之间的配置可能会很复杂。最好使用捆绑的安装程序,它能处理配置的复杂性。

如何下载和安装 PostgreSQL

以下是在 Windows 机器上安装 PostgreSQL 的分步过程:

第一步) 打开您的浏览器。
访问 https://postgresql.ac.cn/download 并选择 Windows

Download and Install PostgreSQL

第二步) 检查选项。
您有两个选项:1) EnterpriseDB 的交互式安装程序和 2) BigSQL 的图形化安装程序。

BigSQL 当前安装的是已弃用的 pgAdmin 版本 3。最好选择 EnterpriseDB,它安装的是最新版本 4。

Download and Install PostgreSQL

第三步) 选择 PostgreSQL 版本。

  1. 系统将提示您选择所需的 PostgreSQL 版本和操作系统。根据您的环境选择最新的 PostgreSQL 版本和操作系统。
  2. 点击下载按钮

Download and Install PostgreSQL

下载将开始

Download and Install PostgreSQL

第四步) 打开 exe 文件。
下载 PostgreSQL 后,打开下载的 exe 文件,然后在安装欢迎屏幕上点击“下一步”。

Download and Install PostgreSQL

第五步) 更新位置。

  1. 如果需要,请更改安装目录,否则保留默认设置。
  2. 点击“下一步”。

Download and Install PostgreSQL

第六步) 选择组件。

  1. 您可以选择要在系统中安装的组件。您可以取消勾选 Stack Builder。
  2. 点击“下一步”。

Download and Install PostgreSQL

第七步) 检查数据位置。

  1. 您可以更改数据位置。
  2. 点击“下一步”。

Download and Install PostgreSQL

第八步) 输入密码。

  1. 输入超级用户密码。请记下它。
  2. 点击“下一步”。

Download and Install PostgreSQL

第九步) 检查端口选项。

  1. 保留默认端口号。
  2. 点击“下一步”。

Download and Install PostgreSQL

第十步) 检查摘要。

  1. 检查安装前摘要。
  2. 点击“下一步”。

Download and Install PostgreSQL

第十一步) 准备安装。
点击“下一步”按钮。

Download and Install PostgreSQL

第十二步) 检查 Stack Builder 提示。
安装完成后,您将看到 Stack Builder 提示。

  1. 取消勾选该选项。我们将在更高级的教程中使用 Stack Builder。
  2. 点击“完成”

Download and Install PostgreSQL

第十三步) 启动 PostgreSQL。
要启动 PostgreSQL,请转到“开始”菜单并搜索“pgAdmin 4”。

Download and Install PostgreSQL

第十四步) 检查 pgAdmin。
您将看到 pgAdmin 主页。

Download and Install PostgreSQL

第十五步) 查找 PostgreSQL 10。
点击左侧树状结构中的“服务器”>“PostgreSQL 10”。

Download and Install PostgreSQL

第十六步) 输入密码。

  1. 输入安装过程中设置的超级用户密码。
  2. 点击确定

Download and Install PostgreSQL

第十七步) 检查仪表板。
您将看到仪表板。

Download and Install PostgreSQL

至此,PostgreSQL 安装完成。

此外,还可以了解更多关于 如何在 Ubuntu 上安装 PostgreSQL 的信息。