在web2py中,在gluon / contrib / pymysql / connections.py中有一个创建新mySQL连接的函数:
C
有没有办法从web2py传递参数到这个函数?
答案 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, ...))