Documentation Home
Connectors and APIs Manual
Download this Manual
PDF (US Ltr) - 4.5Mb
PDF (A4) - 4.5Mb


6.9.3.4 MySQLConnectionPool.set_config() Method

Syntax:

cnxpool.set_config(**kwargs)

This method sets the configuration parameters for connections in the pool. Connections requested from the pool after the configuration change use the new parameters. Connections obtained before the change remain unaffected, but when they are closed (returned to the pool) are reopened with the new parameters before being returned by the pool for subsequent connection requests.

Arguments:

  • kwargs: Connection arguments.

Example:

dbconfig = {
  "database": "performance_schema",
  "user":     "admin",
  "password": "password",
}
cnxpool.set_config(**dbconfig)