Web2py:将参数传递给db Connection()

时间:2016-04-15 13:36:07

标签: mysql web2py

在web2py中,在gluon / contrib / pymysql / connections.py中有一个创建新mySQL连接的函数:

C

有没有办法从web2py传递参数到这个函数?

1 个答案:

答案 0 :(得分:2)

As noted at the very end of this section of the documentation, you can specify a dictionary of driver_args when instantiating DAL:

db = DAL(<connection_string>,
         driver_args=dict(host='localhost', port=3306, ...))