PostgreSQL 客户端——如何启动它?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/5665675/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
PostgreSQL client -- How To Start It?
提问by user3262424
I just installed PostgreSQL-8.4 on Ubuntu. How do I start it / its GUI, connect to a database etc? I know SQL
, but can't find PostgreSQL
's icon in my Ubuntu 10.04 desktop (hence, am not sure how to start it).
我刚刚在 Ubuntu 上安装了 PostgreSQL-8.4。我如何启动它/它的 GUI,连接到数据库等?我知道SQL
,但PostgreSQL
在我的 Ubuntu 10.04 桌面中找不到的图标(因此,我不确定如何启动它)。
回答by grantk
Postgresql has no built in gui.
Postgresql 没有内置的 gui。
to check if it is running run the following from a terminal
要检查它是否正在运行,请从终端运行以下命令
ps aux | grep postgres
You can use psql to access from the command line.
您可以使用 psql 从命令行访问。
to install psql
安装 psql
aptitude install postgresql-client
then to run
然后运行
psql -h dbhost -U username dbname
If you want a gui intall package pgadmin
如果你想要一个 gui 安装包 pgadmin
aptitude install pgadmin3
回答by Neelam
I start postgres prompt by using the following command:
我使用以下命令启动 postgres 提示符:
sudo -u postgres psql
I use Ubuntu 14.04
我使用 Ubuntu 14.04
回答by murasing
If you're a Mac user, try running this
如果您是 Mac 用户,请尝试运行它
postgres -D /usr/local/var/postgres
then do
然后做
psql
回答by Prafull
you may start by firing up a graphical client. In a terminal type : pgadmin3
您可以从启动图形客户端开始。在终端类型中:pgadmin3
You will be presented with the pgAdmin III interface. Click on the "Add a connection to a server" button (top left). In the new dialog, enter the address 127.0.0.1, a description of the server, the default database ("mydb" in the example above), your username ("postgres") and your password.
您将看到 pgAdmin III 界面。单击“添加到服务器的连接”按钮(左上角)。在新对话框中,输入地址 127.0.0.1、服务器描述、默认数据库(上例中的“mydb”)、您的用户名(“postgres”)和密码。
With this GUI you may start creating and managing databases, query the database, execute SQl etc.
使用此 GUI,您可以开始创建和管理数据库、查询数据库、执行 SQL 等。
check out - https://help.ubuntu.com/community/PostgreSQL