MySQL Connector/Python Developer Guide

11.11 _mysql_connector.MySQL.connected() Method

Syntax:

is_connected = ccnx.connected()

Returns True or False to indicate whether the MySQL instance is connected.