@retry(check_exceptions=(pymysql.err.OperationalError,))<EOL>def connect_mysql(host, port, user, password, database):
return pymysql.connect(<EOL>host=host, port=port,<EOL>user=user, passwd=password,<EOL>db=database<EOL>)<EOL>
Connect to MySQL with retries.