在Ubuntu上使用pgAdmin创建数据库的步骤如下:
sudo apt update
sudo apt upgrade
sudo apt install postgresql postgresql-contrib
sudo adduser postgres
sudo -u postgres psql -c "ALTER USER postgres WITH PASSWORD 'your_password';"
sudo apt install pgadmin4
sudo systemctl start pgadmin4
通过浏览器访问 http://your_server_ip:5050
,使用之前设置的管理员账号登录。
在应用程序菜单中找到PgAdmin并启动它,或者在终端中输入以下命令启动pgAdmin 4:
pgadmin4
在PgAdmin的左侧面板中,右键单击“Servers”并选择“Create” “Server…”。
在“General”选项卡中,输入一个名称(例如,“My PostgreSQL Server”)。
转到“Connection”选项卡,输入以下信息:
单击“Save”以保存设置并连接到PostgreSQL服务器。
按照这些步骤,您应该能够在Ubuntu上成功使用pgAdmin创建数据库。