Tryton 3.0:总是“服务器密码错误”

0 投票
1 回答
3642 浏览
提问于 2025-04-17 20:36

在从 ppa:rayanayar/tryton-3.0 安装 Tryton 3.0 后,按照 这个链接 上的脚本,我在尝试通过 Tryton 客户端创建新数据库时,总是收到“错误的服务器密码”的提示。

这是为什么呢?我已经按照要求在 /etc/trytond.conf 文件中输入了全局数据库管理员的密码:

# Configure the Tryton server password
admin_passwd = my_admin_password

我检查了以下几点:

  • tryton 用户在 PostgreSQL 和 Linux 用户中都存在,并且在 trytond.conf 中有他的名字和密码。
  • PostgreSQL 服务器已经重启。

    root@Tryton:~# service postgresql restart
    * Restarting PostgreSQL 9.1 database server                             [ OK ]
    
  • Tryton 服务器已经重启并且正在运行。

    root@Tryton:~# sudo /etc/init.d/tryton-server restart
     * Restarting Tryton Application Platform trytond
    start-stop-daemon: warning: failed to kill 50063: No such process
                                                                     [ OK ]
    
    root@Tryton:~# ps aux | grep trytond
    tryton   37312  0.2  1.0 292796 17368 ?        Sl   Mar01   7:45 /usr/bin/python
     /usr/bin/trytond --config=/etc/trytond.conf --logfile=/var/log/tryton/trytond.log
    root     40178  0.0  2.0 576524 34776 pts/4    Sl+  Mar01   0:03 gedit     /etc/trytond.conf
    root     50332  0.0  0.0   8112   896 pts/6    S+   10:45   0:00 grep --color=auto     
    trytond
    
  • Python 正在监听 localhost:8000 这个端口。

    root@Tryton:~# netstat -tupan | grep python
    tcp       0      0 127.0.0.1:8000          0.0.0.0:*               LISTEN
    37312/python
    
  • 当在“创建配置”中输入“localhost”和“8000”时,客户端显示了“创建”按钮。

1 个回答

1

这真是太奇怪了。

在trytond.conf文件中把管理员密码重置为默认的“admin”后,登录又能用了。

在2.2版本中提到的“创建数据库”的信息被跳过了,数据库直接创建了。在“配置数据库”的对话框中又要求输入密码(没有提示是哪一个),结果发现是本地数据库的管理员密码(也就是为新创建的数据库的管理员用户设置的密码)。

这有点奇怪,但在本地似乎能正常工作。

不过,目前还无法通过互联网连接。


互联网连接的问题也解决了。

最后发现,关于Ubuntu安装的文档(在https://code.google.com/p/tryton/wiki/InstallationOnUbuntu上),现在指向Debian的安装说明,如果能加入一些Gentoo的安装细节,会大大有帮助,因为Gentoo提供了完整的工作配置文件,包括PostgreSQL服务器的设置,这在最后起到了决定性作用。

可以查看http://wiki.gentoo.org/wiki/Tryton

我已经有了

# Activate the json-rpc protocol
jsonrpc = localhost:8000

在添加这些之后,效果非常好:

配置数据库连接

## Note: Only databases owned by db_user will be displayed in the connection dialog
## of the Tryton client. db_user must have create permission for new databases
## to be able to use automatic database creation with the Tryton client.
db_host = localhost
db_port = 5432
db_user = postgres
db_password = postgrsqlpassword
db_minconn = 1
db_maxconn = 64

在我的情况下,我使用tryton作为数据库用户,有些说明更倾向于这样做,显然是出于安全考虑。通过使用postgres(PostgreSQL的内置超级管理员)作为数据库用户,可以避免需要将tryton角色添加到postgres(在Ubuntu上使用apt-get安装的标准包会自动添加这个角色,记得没错的话)。

撰写回答