Closed fatpo closed 6 years ago
just like pymysql, Pass in the parameters
db_pool = tormysql.ConnectionPool(
max_connections=50, # max open connections
idle_seconds=180, # conntion idle timeout time, 0 is not timeout 连接空闲超过idle_seconds 后会自动关闭回收连接的
wait_connection_timeout=3, # wait connection timeout
host=settings.db_host,
user=settings.db_user,
passwd=settings.db_pass,
db=settings.db_name,
charset="utf8",
cursorclass=pymysql.cursors.DictCursor,
autocommit=True
)
thx...
how can I set autocommit? just like pymysql:
my config: