经过几个小时的混战.有点眉目了.
但还是没有完成.
看源文件猜到一些配置文件项. 但貌似配置文件里的项在源代码中未生效.[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_rpc
addons_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]
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]我的神啊.... 脑子都晕刮了...
过些时间再看....
:Q :Q