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


6.9.2.39 MySQLConnection.client_flags Property

Syntax:

Press CTRL+C to copy
>>> cnx.client_flags=flags >>> cnx.clieng_flags

This property sets the client flags to use when connecting to the MySQL server, and returns the set value as an integer. The flags value can be either an integer or a sequence of valid client flag values (see Section 6.9.7, “constants.ClientFlag Class”).

If flags is a sequence, each item in the sequence sets the flag when the value is positive or unsets it when negative. For example, to unset LONG_FLAG and set the FOUND_ROWS flags:

Press CTRL+C to copy
>>> from mysql.connector.constants import ClientFlag >>> cnx.client_flags=[ClientFlag.FOUND_ROWS, -ClientFlag.LONG_FLAG] >>> cnx.reconnect()
Note

Client flags are only set or used when connecting to the MySQL server. It is therefore necessary to reconnect after making changes.