Connector/Python now permits the type for stored procedure parameters to be specified. To do this, specify a parameter as a two-item tuple consisting of the parameter value and type. For more information, see MySQLCursor.callproc() Method. (Bug #71124, Bug #17965619)
It was not possible to initiate an SSL session without explicitly giving a key and certificate. Now it is possible to connect to a MySQL server using only the
ssl_ca
connection argument pointing to a file of CA certificates. This means thessl_key
andssl_cert
connection arguments are optional. However, when either is given, both must be given or anAttributeError
is raised. (Bug #69418, Bug #17054848)-
Connector/Python now supports authentication plugins found in MySQL 5.6. This includes
mysql_clear_password
andsha256_password
, both of which require an SSL connection. Thesha256_password
plugin does not work over a non-SSL connection because Connector/Python does not support RSA encryption.The
connect()
method now supports anauth_plugin
parameter that can be used to force use of a particular plugin. For example, if the server is configured to usesha256_password
by default and you want to connect to an account that authenticates usingmysql_native_password
, either connect using SSL or specifyauth_plugin='mysql_native_password'
. (Bug #68054, Bug #16217765) The
connect()
method now accepts afailover
argument that provides information to use for server failover in the event of connection failures. The argument value is a tuple or list of dictionaries (tuple is preferred because it is nonmutable). Each dictionary contains connection arguments for a given server in the failover sequence. Permitted dictionary values are:user
,password
,host
,port
,unix_socket
,database
,pool_name
,pool_size
. (WL #6166)Connector/Python now enables applications to specify additional information to be used when connecting to Fabric: User name and credentials, and information to use for establishing an SSL connection. The
fabric
dictionary argument to theconnect()
method accepts these additional values:username
,password
,ssl_ca
,ssl_cert
,ssl_key
. Only thessl_ca
value is required to establish an SSL connection. Ifssl_cert
orssl_key
are given, both must be specified. (WL #7558)-
Connector/Python now can report errors to Fabric that occur while accessing a MySQL instance. The information can be used to update the backing store and trigger a failover operation, provided that the instance is a primary server and Fabric has received a sufficient number of problem reports from different connectors.
The
fabric
dictionary argument to theconnect()
method now accepts areport_errors
value. Its default value isFalse
; pass a value ofTrue
to enable error reporting to Fabric.-
To define which errors to report, use the
extra_failure_report()
function:from mysql.connector.fabric import extra_failure_report extra_failure_report([error_code_0, error_code_1, ...])
(WL #7387)
-
A new
MySQLConnection
classreset_connection()
method enables applications to send aCOM_RESET_CONNECTION
to the server. This method is analogous to themysql_reset_connection()
C API function added in MySQL 5.7.3.A new
MySQLConnection
classreset_session()
method is similar toreset_connection()
but falls back to use reauthentication for older servers that do not supportCOM_RESET_CONNECTION
. For more information, see MySQLConnection.cmd_reset_connection() Method, and MySQLConnection.reset_session() Method. (WL #7542)
The
MySQLConnection.autocommit
attribute failed to set the value of theself._autocommit
attribute. (Bug #18172769)Uninstalling Connector/Python using an RPM package failed to remove the
fabric
folder. (Bug #18143073)-
The global
MYSQL_FABRIC_PORT
variable was changed from 8080 to 32274 to match the port change made in Fabric. (Bug #18075339)References: See also: Bug #70954.
For Fabric connections, any
connect_attempts
andconnect_delay
values specified by the user were ignored. (Bug #18055719)For Fabric sharding operations, Connector/Python raised an incorrect error when a table was given with the
tables
connection property for which no sharding information was available. This now results in aDatabaseError
(witherrorcode.ER_BAD_TABLE_ERROR
) mentioning that the table is unknown. (Bug #18047794)For Fabric operations, an incorrect exception was raised by
set_property()
when a connection property value had the wrong type (for example, when thetables
property was not a tuple or a list).set_property()
now correctly raises aValueError
. (Bug #18047758)For Fabric operations, the default mode was supposed to be read/write but was set to read-only. (Bug #18047591)
The delay between attempts when trying to connect to a MySQL Fabric-managed server was not honored. (Bug #71905, Bug #18335432)
Fabric has renamed the dump functionality to a new command called
dump
. Consequently, Connector/Python now uses the new functionsdump.sharding_information,
dump.fabric_nodes
, anddump.servers.
(Bug #71124, Bug #17965619)MySQLCursor.executemany()
caused aUnicodeDecodeError
when non-ASCII characters existed in theseq_params
parameter and the operation was a Unicode instance with Python 2. This is now corrected by encoding the operation per the current connection character set. (Bug #69067, Bug #18220593)