sql execute way changed from local command to MySQLdb library (DB backup & restore ways remain the old way for performance), data with single quote replaced with 2 single quotes for SQL issue, multiple SQL command executed separately.