如果用户输入无效的sql作为UnboundLocalError: local variable 'row' referenced before assignment (因为行是空的,所以sql是错误的),那么如何有效地处理这个错误?def DBQuery(sql):
c = MySQLdb.connect(host=HOST,user=USER,passwd=PASS,db=DB, cursorclass=MySQLdb.cursors.DictCursor
但是,在错误日志中没有任何警告或例外情况下,它就会失败。语法: tar -警告=无文件更改的-zcvf $bkpdir${hadoopdb}mysqldb$bkpday.sql.tar.gz $bkpdir${hadoopdb}mysqldb$bkpday.sql执行上述命令时是否有任何方法捕捉错误。mysqldb_$bkpday.sql
then
echo "Error while compressing the db b