Django database shells have an is_usable()
method that checks the server for viruses. This is for MySQL -
def is_usable(self): try: self.connection.ping() except DatabaseError: return False else: return True
From the MySQL URL you provided -
If auto-connect is enabled, mysql_ping () reconnects. Otherwise, it returns an error.
So it all depends on how you configured this part -
mysql_options(&mysql, MYSQL_OPT_RECONNECT, &reconnect);
which you must install in the DBMS.
Bibhas debnath
source share