在 Ubuntu 上启动 pgAdmin 取决于你安装的方式,常见有 桌面版(pgAdmin 4 Desktop) 和 Web 版(pgAdmin 4 Server Mode) 两种。
pgadmin4
或
pgadmin4-desktop
(具体命令取决于安装方式)
如果你是通过 apt 安装的 pgAdmin 4:
sudo systemctl start apache2
然后在浏览器访问:
http://localhost/pgadmin4
sudo systemctl enable apache2
pgadmin4
或
python3 -m pgadmin4
首次启动会让你设置登录邮箱和密码。
which pgadmin4
如果没有结果,可能是没装桌面版:
sudo apt install pgadmin4-desktop
确认服务是否在运行:
sudo systemctl status apache2
默认是 80 或 5050,可在配置文件中修改。
如果你愿意,可以告诉我:
我可以给你更精确的启动方法。