如何在 Debian 11 上安装 pgAdmin
admin
2023-07-31 09:48:46
0

pgAdmin 是一个免费且开源的基于 Web 的工具,它提供了一个友好的 Web 界面来全面管理 PostgreSQL 数据库,并且它包括一些可以帮助您轻松管理和维护数据库的功能。它是用 Python 编写的,支持许多操作系统,如 Linux、Windows 和 macOS。postgresql-logopostgresql-logo

在 Debian 11 Bullseye 上安装 pgAdmin

步骤 1. 在我们安装任何软件之前,通过apt在终端中运行以下命令来确保您的系统是最新的很重要:

sudo apt update
sudo apt upgrade
sudo apt install wget software-properties-common apt-transport-https gnupg gnupg2

步骤 2. 安装 PostgreSQL。

在安装 pgAdmin5 之前,必须在您的服务器上安装 PostgreSQL 服务器。现在运行以下命令来安装它:

sudo apt install postgresql

安装PostgreSQL 后,启动 PostgreSQL 服务并使其在系统重启时启动:

sudo systemctl start postgresql
sudo systemctl enable postgresql
sudo systemctl status postgresql

步骤 3. 在 Debian 11 上安装 pgAdmin。

默认情况下,无法直接从 Debian 11 基础存储库安装 pgAdmin。现在我们将官方 pgAdmin 存储库添加到您的系统中:

echo \"deb https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/$(lsb_release -cs) pgadmin4 main\"\\
| sudo tee /etc/apt/sources.list.d/pgadmin4.list

接下来,使用以下命令导入 pgAdmin 存储库的 GPG 密钥:

curl https://www.pgadmin.org/static/packages_pgadmin_org.pub | sudo apt-key add

之后,使用以下命令安装 pgAdmin:

sudo apt update
sudo apt install pgadmin4-web

步骤 4. 配置 pgAdmin。

现在我们在访问它之前设置 pgAdmin 4:

sudo /usr/pgadmin4/bin/setup-web.sh

您将被要求提供您的电子邮件和密码以完成如下所示的配置:

Setting up pgAdmin 4 in web mode on a Debian based platform...
Creating configuration database...
NOTE: Configuring authentication for SERVER mode.

Enter the email address and password to use for the initial pgAdmin user account:

Email address: admin@idroot.us
Password: your-strong-passwd
Retype password: your-strong-passwd
pgAdmin 4 - Application Initialisation
======================================

Creating storage and log directories...
We can now configure the Apache Web server for you. This involves enabling the wsgi module and configuring the pgAdmin 4 application to mount at /pgadmin4. Do you wish to continue (y/n)? y << Type y and press Enter
The Apache web server is running and must be restarted for the pgAdmin 4 installation to complete. Continue (y/n)? y << Type y and press Enter
Apache successfully restarted. You can now start using pgAdmin 4 in web mode at http://127.0.0.1/pgadmin

步骤 5. 配置防火墙。

在您可以访问 pgadmin4 Web 界面之前,如果您运行了 UFW 防火墙,则需要打开端口 80 (HTTP) 以允许 Apache 服务上的传入流量,如下所示:

sudo ufw allow 80
sudo ufw allow 443
sudo ufw status

步骤 6. 访问 PgAdmin Web 界面。

成功安装后,打开 Web 浏览器并键入 URL以访问 pgAdmin4 Web 界面。您将被重定向到 pgAdmin4 登录页面:http://your-server-ip/pgadmin4

pgadmin4-login-pagepgadmin4-login-page

感谢您使用本教程在 Debian 11 Bullseye 上安装最新版本的 pgAdmin。如需其他帮助或有用信息,我们建议您查看官方 pgAdmin 网站。

相关内容

热门资讯

Windows 11 和 10... Windows 11/10 文件夹属性中缺少共享选项卡 – 已修复 1.检查共享选项卡是否可用 右键...
Radmin VPN Wind... Radmin VPN 是一款免费且用户友好的软件,旨在牢固地连接计算机以创建一个有凝聚力的虚拟专用网...
如何修复 Steam 内容文件... Steam 内容文件锁定是当您的 Steam 文件无法自行更新时出现的错误。解决此问题的最有效方法之...
在 Windows 11 中打... 什么是链路状态电源管理? 您可以在系统控制面板的电源选项中看到链接状态电源管理。它是 PCI Exp...
iPhone 屏幕上有亮绿色斑... iPhone 是市场上最稳定的智能手机之一,这主要归功于专为它们设计的 iOS 操作系统。然而,他们...
事件 ID 7034:如何通过... 点击进入:ChatGPT工具插件导航大全 服务控制管理器 (SCM) 负责管理系统上运行的服务的活动...
QQ浏览器怎么制作简历 QQ浏览器是腾讯公司开发的一款极速浏览器,支持电脑,安卓,苹果等多种终端;更快的浏览体验,更安全的浏...
Hive OS LOLMine... 目前不清退的交易所推荐: 1、全球第二大交易所OKX欧意 国区邀请链接: https://www.m...
Apple Watch Ult... 所有运行 watchOS 7 或更高版本的 Apple Watch 型号都包含一项名为“优化电池充电...
统信UOS每次开机后不直接进入... 统信UOS每次开机后不直接进入系统而是进入到recovery模式 按方向上键选择UOS 20 SP1...