2

我正在按照下面提到的安装步骤操作,但遇到了 python 问题。

https://en.wikibooks.org/wiki/GNU_Health/Installation#Installing_GNU_Health_on_GNU/Linux_and_FreeBSD

在要执行数据库实例初始化的步骤,执行以下命令后遇到以下错误。

python3 ./trytond-admin --all --database=health

遇到的错误:

Traceback (most recent call last):
  File "./trytond-admin", line 21, in <module>
    admin.run(options)
  File "/home/gnuhealth/gnuhealth/tryton/server/trytond-4.6.18/trytond/admin.py", line 24, in run
    with Transaction().start(db_name, 0, _nocache=True):
  File "/home/gnuhealth/gnuhealth/tryton/server/trytond-4.6.18/trytond/transaction.py", line 88, in start
    database = Database(database_name).connect()
  File "/home/gnuhealth/gnuhealth/tryton/server/trytond-4.6.18/trytond/backend/postgresql/database.py", line 97, in __new__
    **cls._connection_params(name))
  File "/home/gnuhealth/.local/lib/python3.6/site-packages/psycopg2/pool.py", line 161, in __init__
    self, minconn, maxconn, *args, **kwargs)
  File "/home/gnuhealth/.local/lib/python3.6/site-packages/psycopg2/pool.py", line 58, in __init__
    self._connect()
  File "/home/gnuhealth/.local/lib/python3.6/site-packages/psycopg2/pool.py", line 62, in _connect
    conn = psycopg2.connect(*self._args, **self._kwargs)
  File "/home/gnuhealth/.local/lib/python3.6/site-packages/psycopg2/__init__.py", line 126, in connect
    conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
psycopg2.OperationalError: fe_sendauth: no password supplied


谁能帮我解决这个错误或告诉我我错过了什么?
根据错误,我怀疑连接到数据库有困难,因为没有指定密码。

4

1 回答 1

0

您似乎没有使用凭据配置 URI 以连接到数据库。您可以在http://docs.tryton.org/projects/server/en/latest/topics/configuration.html#uri找到配置文件的描述。 一旦有了配置文件,您必须像这样运行命令:

python3 ./trytond-admin --all --database=health -c /path/to/trytond.conf

于 2019-08-13T11:08:17.177 回答