0
나는 excel 파일에 저장 한 웹 스크래핑 스크립트를 작성하고이 excel 파일을 내 MySQL DB 서버에 업로드 한 후 업로드합니다. 오류 메시지가 표시되지 않지만 MySQL의 테이블이 비어 있습니다. 왜? 내가 틀렸어? 여기 mysqldb 부분왜 내 mysqldb 코드가 작동하지 않습니까? 오류 메시지 없음, 데이터 없음
은 :
connection = MySQLdb.connect(host='localhost',
user='root',
passwd='',
db='database1')
cursor = connection.cursor()
query = """ load data local infile '/usr/src/Python-2.7.13/output.csv'
into table ARRIVALS
character set latin1
fields terminated by ';'
enclosed by '"'
lines terminated by '\r\n'
ignore 1 lines;
"""
cursor.execute(query)
connection.commit()
cursor.close()
time.sleep(30)
감사합니다. 로이, 작동 중입니다! –