Participer au site avec un Tip
Rechercher
 

Améliorations / Corrections

Vous avez des améliorations (ou des corrections) à proposer pour ce document : je vous remerçie par avance de m'en faire part, cela m'aide à améliorer le site.

Emplacement :

Description des améliorations :

Vous êtes un professionnel et vous avez besoin d'une formation ? Deep Learning avec Python
et Keras et Tensorflow
Voir le programme détaillé
Module « mysql.connector »

Classe « MySQLConnection »

Informations générales

Héritage

builtins.object
    ABC
        MySQLConnectionAbstract
            MySQLConnection

Définition

class MySQLConnection(MySQLConnectionAbstract):

help(MySQLConnection)

Connection to a MySQL Server

Constructeur(s)

Signature du constructeur Description
__init__(self, **kwargs: 'Any') -> 'None'

Liste des propriétés

Nom de la propriétéDescription
autocommitGets whether autocommit is on or off. [extrait de autocommit.__doc__]
can_consume_resultsReturns whether to consume results. [extrait de can_consume_results.__doc__]
charsetReturns the character set for current connection. [extrait de charset.__doc__]
charset_idThe charset ID utilized during the connection phase. [extrait de charset_id.__doc__]
collationReturns the collation for current connection. [extrait de collation.__doc__]
connection_idMySQL connection ID [extrait de connection_id.__doc__]
databaseGet the current database [extrait de database.__doc__]
get_warningsGets whether this connection retrieves warnings automatically. [extrait de get_warnings.__doc__]
have_next_resultReturns If have next result. [extrait de have_next_result.__doc__]
in_transactionMySQL session has started a transaction [extrait de in_transaction.__doc__]
is_secureReturns `True` if is a secure connection. [extrait de is_secure.__doc__]
pool_config_versionReturns the pool configuration version. [extrait de pool_config_version.__doc__]
python_charsetReturns the Python character set for current connection. [extrait de python_charset.__doc__]
query_attrsReturns query attributes list. [extrait de query_attrs.__doc__]
raise_on_warningsGets whether this connection raises an error on warnings. [extrait de raise_on_warnings.__doc__]
read_timeout
server_hostMySQL server IP address or name. [extrait de server_host.__doc__]
server_portMySQL server TCP/IP port. [extrait de server_port.__doc__]
sql_modeGets the SQL mode. [extrait de sql_mode.__doc__]
time_zoneGets the current time zone. [extrait de time_zone.__doc__]
unix_socketThe Unix socket file for connecting to the MySQL server. [extrait de unix_socket.__doc__]
unread_resultGets whether there is an unread result. [extrait de unread_result.__doc__]
userThe user name used for connecting to the MySQL server. [extrait de user.__doc__]
write_timeout

Liste des opérateurs

Opérateurs hérités de la classe object

__eq__, __ge__, __gt__, __le__, __lt__, __ne__

Liste des méthodes

Toutes les méthodes Méthodes d'instance Méthodes statiques Méthodes dépréciées
Signature de la méthodeDescription
close(self) -> 'None' Disconnect from the MySQL server [extrait de close.__doc__]
cmd_change_user(self, username: 'str' = '', password: 'str' = '', database: 'str' = '', charset: 'Optional[int]' = None, password1: 'str' = '', password2: 'str' = '', password3: 'str' = '', oci_config_file: 'str' = '', oci_config_profile: 'str' = '', openid_token_file: 'str' = '') -> 'Optional[OkPacketType]' Change the current logged in user [extrait de cmd_change_user.__doc__]
cmd_debug(self) -> 'EofPacketType' Send the DEBUG command [extrait de cmd_debug.__doc__]
cmd_init_db(self, database: 'str') -> 'OkPacketType' Change the current database [extrait de cmd_init_db.__doc__]
cmd_ping(self) -> 'OkPacketType' Send the PING command [extrait de cmd_ping.__doc__]
cmd_process_kill(self, mysql_pid: 'int') -> 'OkPacketType' Kill a MySQL process [extrait de cmd_process_kill.__doc__]
cmd_query_iter(self, statements: 'StrOrBytes', **kwargs: 'Any') -> 'Generator[ResultType, None, None]' Send one or more statements to the MySQL server [extrait de cmd_query_iter.__doc__]
cmd_quit(self) -> 'bytes' Close the current connection with the server [extrait de cmd_quit.__doc__]
cmd_refresh(self, options: 'int') -> 'OkPacketType'
cmd_reset_connection(self) -> 'bool' Resets the session state without re-authenticating [extrait de cmd_reset_connection.__doc__]
cmd_shutdown(self, shutdown_type: 'Optional[int]' = None) -> 'None' Shut down the MySQL Server [extrait de cmd_shutdown.__doc__]
cmd_statistics(self) -> 'StatsPacketType' Send the statistics command to the MySQL Server [extrait de cmd_statistics.__doc__]
cmd_stmt_close(self, statement_id: 'int', **kwargs: 'Any') -> 'None' Deallocate a prepared MySQL statement [extrait de cmd_stmt_close.__doc__]
cmd_stmt_fetch(self, statement_id: 'int', rows: 'int' = 1, **kwargs: 'Any') -> 'None' Fetch a MySQL statement Result Set [extrait de cmd_stmt_fetch.__doc__]
cmd_stmt_prepare(self, statement: 'bytes', **kwargs: 'Any') -> 'Mapping[str, Union[int, List[DescriptionType]]]' Prepare a MySQL statement [extrait de cmd_stmt_prepare.__doc__]
cmd_stmt_reset(self, statement_id: 'int', **kwargs: 'Any') -> 'None' Reset data for prepared statement sent as long data [extrait de cmd_stmt_reset.__doc__]
cmd_stmt_send_long_data(self, statement_id: 'int', param_id: 'int', data: 'BinaryIO', **kwargs: 'Any') -> 'int' Send data for a column [extrait de cmd_stmt_send_long_data.__doc__]
commit(self) -> 'None' Commit current transaction [extrait de commit.__doc__]
consume_results(self) -> 'None' Consume results [extrait de consume_results.__doc__]
cursor(self, buffered: 'Optional[bool]' = None, raw: 'Optional[bool]' = None, prepared: 'Optional[bool]' = None, cursor_class: 'Optional[Type[MySQLCursor]]' = None, dictionary: 'Optional[bool]' = None, named_tuple: 'Optional[bool]' = None, read_timeout: 'Optional[int]' = None, write_timeout: 'Optional[int]' = None) -> 'MySQLCursor' Instantiates and returns a cursor [extrait de cursor.__doc__]
disconnect(self) -> 'None' Disconnect from the MySQL server [extrait de close.__doc__]
get_row(self, binary: 'bool' = False, columns: 'Optional[List[DescriptionType]]' = None, raw: 'Optional[bool]' = None, prep_stmt: 'Optional[CMySQLPrepStmt]' = None, **kwargs: 'Any') -> 'Tuple[Optional[RowType], Optional[EofPacketType]]' Get the next rows returned by the MySQL server [extrait de get_row.__doc__]
get_rows(self, count: 'Optional[int]' = None, binary: 'bool' = False, columns: 'Optional[List[DescriptionType]]' = None, raw: 'Optional[bool]' = None, prep_stmt: 'Optional[CMySQLPrepStmt]' = None, **kwargs: 'Any') -> 'Tuple[List[RowType], Optional[EofPacketType]]' Get all rows returned by the MySQL server [extrait de get_rows.__doc__]
handle_unread_result(self) -> 'None' Check whether there is an unread result [extrait de handle_unread_result.__doc__]
info_query(self, query: 'str') -> 'Optional[RowType]' Send a query which only returns 1 row [extrait de info_query.__doc__]
is_connected(self) -> 'bool' Reports whether the connection to MySQL Server is available [extrait de is_connected.__doc__]
ping(self, reconnect: 'bool' = False, attempts: 'int' = 1, delay: 'int' = 0) -> 'None' Check availability of the MySQL server [extrait de ping.__doc__]
reset_session(self, user_variables: 'Optional[Dict[str, Any]]' = None, session_variables: 'Optional[Dict[str, Any]]' = None) -> 'None' Clears the current active session [extrait de reset_session.__doc__]
rollback(self) -> 'None' Rollback current transaction [extrait de rollback.__doc__]
set_allow_local_infile_in_path(self, path: 'str') -> 'None' Set the path that user can upload files. [extrait de set_allow_local_infile_in_path.__doc__]
shutdown(self) -> 'None' Shut down connection to MySQL Server. [extrait de shutdown.__doc__]

Méthodes héritées de la classe MySQLConnectionAbstract

__enter__, __exit__, __init_subclass__, __subclasshook__, cmd_process_info, cmd_query, cmd_stmt_execute, config, connect, get_self, get_server_info, get_server_version, isset_client_flag, query_attrs_append, query_attrs_clear, query_attrs_remove, reconnect, set_charset_collation, set_client_flags, set_converter_class, set_login, set_unicode, start_transaction

Méthodes héritées de la classe object

__delattr__, __dir__, __format__, __getattribute__, __getstate__, __hash__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__

Vous êtes un professionnel et vous avez besoin d'une formation ? Deep Learning avec Python
et Keras et Tensorflow
Voir le programme détaillé