OpenObject server-sa 部分如何使用 OpenERP Client 连接?
-
从官方bzr 出源码后, 在 Windows 下使用py2exe 编译成 exe 后(包括了 OpenERP-server服务) 安装一切正常.
运行也正常但就是使用 OpenERP Client 连不上. 另 opener-server.conf 文件也不存在. 不知道要如何配置数据库设置方面的东西.
有了解的吗? 谢谢.另附启动LOG:
<code>
[2010-01-02 14:05:39,592] INFO:server:version - 5.0.0
[2010-01-02 14:05:39,592] INFO:server:addons_path - D:OpenERPserver-sadistad
dons
[2010-01-02 14:05:39,592] INFO:server:database hostname - localhost
[2010-01-02 14:05:39,592] INFO:server:database port - 5432
[2010-01-02 14:05:39,592] INFO:server:database user - Administrator
[2010-01-02 14:05:39,592] INFO:objects:initialising distributed objects services[2010-01-02 14:05:39,608] INFO:web-services:starting XML-RPC services, port 8069
[2010-01-02 14:05:39,624] INFO:web-services:starting NET-RPC service, port 8070
[2010-01-02 14:05:39,624] INFO:web-services:the server is running, waiting for c
onnections...</code>
-
经过几个小时的混战.有点眉目了.
但还是没有完成.
看源文件猜到一些配置文件项. 但貌似配置文件里的项在源代码中未生效.[code]
[options]
engine = mysql://root@localhost:3306/test
db_host = localhost
db_port = 3306
db_name = test
db_user = root
db_password = ""secure_pkey_file = server.pkey
secure_cert_file = server.cert
logfile = openerp-server.log
root_path = D:OpenERPserver-sadist
port = 8069
netport = 8070
admin_passwd = admin
xmlrpc = True
netrpc = True
log_level = debug_rpcaddons_path = D:OpenERPserver-sadistaddons
[/code]改后. 报错提示 tiny 用户连接 mysql 失败. 怎么会是 tiny 呢? 分明指定了db_user = root 嘛.
没有办法. 把 sql_db.py 里连接数据库的地方,强制写死 连接 dsn[code]
dburl = tools.config['engine'] # 这里从 tools.config['engine']读出来的默认值是 postgresql://tiny:123456@localhost:5432
dburl = 'mysql://root:@localhost:3306'
[/code]强制 指定后.
在 cls.engine = create_engine(cls.dsn(db_name), encoding='utf-8', pool_size=cls.maxconn, max_overflow=10, echo_pool=False, echo=False)处 出错.
但这行代码 直接在 Python 命令行 是连接成功的.
>>>a = sqlalchemy.create_engine('mysql://root@localhost:3306/test', encoding='utf-8', pool_size=10, max_overflow=10, echo_pool=False, echo=False)
Engine(......)
>>>然后怀疑 sqlalchemy 的 MySQLdb 驱动没有整对.然后在 server-sa 的编译的时候. 强制加上 MySQLdb 的扩展.. 运行还是未果.[code]
:Q
File "sql_db.pyo", line 332, in db_connect
File "sql_db.pyo", line 312, in get
File "sqlalchemyengine__init__.pyo", line 223, in create_engine
File "sqlalchemyenginestrategies.pyo", line 48, in create
File "sqlalchemyengineurl.pyo", line 95, in get_dialect
ImportError: No module named pkg_resources
[/code]我的神啊.... 脑子都晕刮了...
过些时间再看....