gpt4 book ai didi

postgresql - Openbravo postgres 安装

转载 作者:行者123 更新时间:2023-11-29 13:03:04 27 4
gpt4 key购买 nike

我正在尝试在 Ubuntu 上获取 Openbravo 的副本以进行开发。我正在关注 official guide我被 Postgres 错误卡住了。

我已经通过 mercurial 命令成功下载了源代码。 Ant 设置也对我有用。

当我运行向导时,我会写下这些信息。

Wizard

当我运行 ant install.source 时出现问题:

BUILD FAILED
/home/User/openbravo/build.xml:734: The following error occurred while executing this line:
/home/User/openbravo/src-db/database/build-create.xml:50: The following error occurred while executing this line:
/home/marcguilera/openbravo/src-db/database/build-create.xml:77: org.postgresql.util.PSQLException: Connection refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:136)
at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:66)
at org.postgresql.jdbc2.AbstractJdbc2Connection.<init>(AbstractJdbc2Connection.java:125)
at org.postgresql.jdbc3.AbstractJdbc3Connection.<init>(AbstractJdbc3Connection.java:30)

堆栈跟踪更长。

最佳答案

我)首先我们需要更改 PostgreSQL postgres 用户密码,否则我们将无法访问服务器。作为“postgres”Linux 用户,我们将执行下面的 psql 命令。


在终端中输入:

$ sudo -u postgres psql postgres

使用以下命令为“postgres”数据库角色设置密码:

\password postgres

二)创建数据库


要创建我们称之为 leo 的第一个数据库,只需键入:

sudo -u postgres createdb leo

III) 为 Postgresql 9.1 安装 Server Instrumentation(用于 PgAdmin)


PgAdmin 需要安装附加组件才能获得全部功能。 “adminpack”插件,它称为 Server Instrumentation,是 postgresql-contrib 的一部分,因此您必须安装该包。然后激活扩展,对于“Postgresql 9.1”+ 在“postgres”数据库中安装 adminpack“扩展”:

$ sudo -u postgres psql


然后

CREATE EXTENSION adminpack;

IV) 使用 pgAdmin III GUI


要了解 PostgreSQL 可以做什么,您可以从启动图形客户端开始。在终端类型中:

pgadmin3

您将看到 pgAdmin III 界面。* 单击“添加到服务器的连接”按钮(左上角)。

在新对话框中:

enter the address **127.0.0.1** 

host is **jdbc:postgresql://localhost:5432/postgres**

the default database ("leo" in the example above)
  • 您的用户名(“postgres”)和您的密码。

为了让 pgAdmin III 连接到服务器,还需要一个步骤,那就是编辑 pg_hba.conf 文件并将身份验证方法从 peer 更改为 md5(如果你还没有设置密码。):

sudo nano /etc/postgresql/9.1/main/pg_hba.conf

然后换行

# Database administrative login by Unix domain socket
local all postgres peer

# Database administrative login by Unix domain socket
local all postgres md5

现在您应该重新加载服务器配置更改并将 pgAdmin III 连接到您的 PostgreSQL 数据库服务器。

sudo /etc/init.d/postgresql reload

使用此 GUI,您可以开始创建和管理数据库、查询数据库、执行 SQl 等。

https://help.ubuntu.com/community/PostgreSQL

v) 使用 postgres 运行 openbravo


只需调整数据库名称、用户名和密码即可。 希望对您有所帮助。

关于postgresql - Openbravo postgres 安装,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23106241/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com