pyMySQL2 pymysql.err.InterfaceError: (0, '') pymysql.err.InterfaceError:(0,") 이 경에는 connection을 한 후 close() 부분이 이상하게 되어있지는 않은지 확인 2020. 8. 26. 파이썬 mysql 로그 삽입 pymysql 을 이용한 mysql db로그 삽입하기. import pymysql conn = pymysql.connect(host='localhost', user='hello_mysql', password='1', db='logs', charset='utf8') curs = conn.cursor() sql = "insert into access_log(ip, access_time, method, uri, status)\ values (%s,%s, %s, %s,%s)" logfile_path = '/경로/' logfile_fullpath = logfile_path + '파일이름' count = 0 with open(logfile_fullpath, 'r') as f: for line in f: count .. 2020. 8. 25. 이전 1 다음