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 :

Module « mysql.connector »

Classe « MySQLConnection »

Informations générales

Héritage

    builtins.object
builtins.object
    MySQLConnectionAbstract
        MySQLConnectionAbstract
            MySQLConnection

Définition

class MySQLConnection(MySQLConnectionAbstract):

Description [extrait de MySQLConnection.__doc__]

Connection to a MySQL Server

Constructeur(s)

Signature du constructeur Description
__init__(self, *args, **kwargs)

Liste des propriétés

Nom de la propriétéDescription
autocommitGet whether autocommit is on or off [extrait de __doc__]
can_consume_resultsReturns whether to consume results [extrait de __doc__]
charsetReturns the character set for current connection [extrait de __doc__]
collationReturns the collation for current connection [extrait de __doc__]
connection_idMySQL connection ID [extrait de __doc__]
databaseGet the current database [extrait de __doc__]
get_warningsGet whether this connection retrieves warnings automatically [extrait de __doc__]
in_transactionMySQL session has started a transaction [extrait de __doc__]
python_charsetReturns the Python character set for current connection [extrait de __doc__]
raise_on_warningsGet whether this connection raises an error on warnings [extrait de __doc__]
server_hostMySQL server IP address or name [extrait de __doc__]
server_portMySQL server TCP/IP port [extrait de __doc__]
sql_modeGet the SQL mode [extrait de __doc__]
time_zoneGet the current time zone [extrait de __doc__]
unix_socketMySQL Unix socket file location [extrait de __doc__]
unread_resultGet whether there is an unread result [extrait de __doc__]
userUser used while connecting to MySQL [extrait de __doc__]

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) Disconnect from the MySQL server [extrait de close.__doc__]
cmd_change_user(self, username='', password='', database='', charset=45) Change the current logged in user [extrait de cmd_change_user.__doc__]
cmd_debug(self) Send the DEBUG command [extrait de cmd_debug.__doc__]
cmd_init_db(self, database) Change the current database [extrait de cmd_init_db.__doc__]
cmd_ping(self) Send the PING command [extrait de cmd_ping.__doc__]
cmd_process_kill(self, mysql_pid) Kill a MySQL process [extrait de cmd_process_kill.__doc__]
cmd_query(self, query, raw=False, buffered=False, raw_as_string=False) Send a query to the MySQL server [extrait de cmd_query.__doc__]
cmd_query_iter(self, statements) Send one or more statements to the MySQL server [extrait de cmd_query_iter.__doc__]
cmd_quit(self) Close the current connection with the server [extrait de cmd_quit.__doc__]
cmd_refresh(self, options) Send the Refresh command to the MySQL server [extrait de cmd_refresh.__doc__]
cmd_reset_connection(self) Resets the session state without re-authenticating [extrait de cmd_reset_connection.__doc__]
cmd_shutdown(self, shutdown_type=None) Shut down the MySQL Server [extrait de cmd_shutdown.__doc__]
cmd_statistics(self) Send the statistics command to the MySQL Server [extrait de cmd_statistics.__doc__]
cmd_stmt_close(self, statement_id) Deallocate a prepared MySQL statement [extrait de cmd_stmt_close.__doc__]
cmd_stmt_execute(self, statement_id, data=(), parameters=(), flags=0) Execute a prepared MySQL statement [extrait de cmd_stmt_execute.__doc__]
cmd_stmt_fetch(self, statement_id, rows=1) Fetch a MySQL statement Result Set [extrait de cmd_stmt_fetch.__doc__]
cmd_stmt_prepare(self, statement) Prepare a MySQL statement [extrait de cmd_stmt_prepare.__doc__]
cmd_stmt_reset(self, statement_id) Reset data for prepared statement sent as long data [extrait de cmd_stmt_reset.__doc__]
cmd_stmt_send_long_data(self, statement_id, param_id, data) Send data for a column [extrait de cmd_stmt_send_long_data.__doc__]
commit(self) Commit current transaction [extrait de commit.__doc__]
consume_results(self) Consume results [extrait de consume_results.__doc__]
cursor(self, buffered=None, raw=None, prepared=None, cursor_class=None, dictionary=None, named_tuple=None) Instantiates and returns a cursor [extrait de cursor.__doc__]
disconnect(self) Disconnect from the MySQL server [extrait de close.__doc__]
get_row(self, binary=False, columns=None, raw=None) Get the next rows returned by the MySQL server [extrait de get_row.__doc__]
get_rows(self, count=None, binary=False, columns=None, raw=None, prep_stmt=None) Get all rows returned by the MySQL server [extrait de get_rows.__doc__]
handle_unread_result(self) Check whether there is an unread result [extrait de handle_unread_result.__doc__]
info_query(self, query) Send a query which only returns 1 row [extrait de info_query.__doc__]
is_connected(self) Reports whether the connection to MySQL Server is available [extrait de is_connected.__doc__]
ping(self, reconnect=False, attempts=1, delay=0) Check availability of the MySQL server [extrait de ping.__doc__]
reconnect(self, attempts=1, delay=0) Attempt to reconnect to the MySQL server [extrait de reconnect.__doc__]
reset_session(self, user_variables=None, session_variables=None) Clears the current active session [extrait de reset_session.__doc__]
rollback(self) Rollback current transaction [extrait de rollback.__doc__]
set_allow_local_infile_in_path(self, path) set local_infile_in_path [extrait de set_allow_local_infile_in_path.__doc__]
shutdown(self) 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, config, connect, get_server_info, get_server_version, isset_client_flag, 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__, __hash__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__