0
"청구 계좌"테이블에 데이터를 삽입하려고하는데 다음과 같은 방법을 시도했습니다. 데이터가 표에 어떻게 삽입되지 않는지 오류는 없었습니다. 내가 여기서 뭐 잘못하고있는거야? 나는이 작업을 위해 파이썬의 mysql.connector 모듈을 사용하고있다.mysql.connector를 사용하여 mysql db에 데이터를 삽입하십시오.
def billingaccounts(self,stag,prod):
print "Updating the consilidated daily bills for stag and prod"
cursor = self.testdb.cursor()
stag = 87
prod = 45
now = '2016-06-03'
to = 84
cursor.execute('INSERT INTO iaas.billing_accounts (date, staging_account, production_acount, total) VALUES (%s, %s, %s, %s)',(now,stag,prod,to))
나는이 특정 모듈을 모르지만, 당신은 자동 커밋 모드에 확신? 또는 삽입 한 후에 커밋하면 안됩니까? – spectras
고마워요. –