I have been trying to write a script to test if connection to a certain mysql DB is possible.
If it is possible it should give a "OK" Output and if not It is suppose to say "FAIL" and carry on with operation.
It works fine when connection is available. But when the connection fails to connect the script gets exited giving an error
_mysql_exceptions.OperationalError: (1045, "Access denied for user 'yoda'@'localhost' (using password: YES)")
But this interferes from script doing rest of the process
I called it like
if not db.connect(UnivConf['DBHT'],UnivConf['DBUN'],UnivConf['DBPW'],UnivConf['DBDB'])
How can I solve this problem and get the script to continue on without quitting
try ... exceptblock?