Documentation Home
MySQL Connector/Python Developer Guide
Related Documentation Download this Manual
PDF (US Ltr) - 0.7Mb
PDF (A4) - 0.7Mb


MySQL Connector/Python Developer Guide  /  ...  /  MySQLConnection.converter-class Property

10.2.43 MySQLConnection.converter-class Property

This property sets and returns the converter class to use when configuring the connection.

# get the current converter class being used
print(cnx.converter_class)
>> <class 'mysql.connector.conversion.MySQLConverter'>

class TestConverter(MySQLConverterBase): ...

# set the custom converter class
cnx.converter_class = TestConverter
print(cnx.converter_class)
>> <class '__main__.TestConverter'>