2
내가 뭘 잘못하고 있는지 알고 싶습니까? 오류 메시지가 없으며 스크립트가 정상적으로 실행되지만 레코드가 db에 삽입되지 않습니다. 데이터베이스에서 삽입 쿼리를 실행하면 정상적으로 작동합니다.파이썬 mysqldb가 작동하지 않습니다 - 에러 메시지가 없습니다.
가짜 IP 또는 암호를 입력해도 오류가 생성되지 않습니다.
이것은 파이썬 2.7과 mysqldb 2.7 윈도우 바이너리가있는 윈도우에 있습니다.
import os, sys, time, glob, shlex, subprocess, MySQLdb
try:
db=MySQLdb.connect(host="my.sql.server.ip.here",user="encoding",passwd="passhere",db="encoding")
except MySQLdb.Error, e:
print "Error %d: %s" % (e.args[0], e.args[1])
sys.exit (1)
c=db.cursor()
c.execute("""INSERT INTO test (jobid, frame) VALUES (%s, %s)""",("asdf", "s[1]"))
c.close()
db.close()