python에서 pymysql함수를 이용해 mysql table을 만들고 싶습니다.(에러사진 첨부)
조회수 703회
DAILYINFORMATION이라는 table을 만드려고 하는데 에러가 나네요 안에 code, name, date, quarter, 12FWPER, 12FWPBR, AVLS, TVmean60 이라는 변수를 포함하고 싶습니다. data type은 각각 text, text, date, int(11), bigint(11), bigint(11), bigint(11), bigint(11)입니다. 에러가 난 이유를 알려주시면 감사하겠습니다.
import xlrd
import pymysql
conn = pymysql.connect(host = "192.168.0.33", port=3306, user = "root", password = "kone", db = "FactorScoringModel")
try:
with conn.cursor() as cursor:
sql = '''
CREATE TABLE DAILYINFORMATION (
code text, name text, date date, quarter int(11)
12FWPER bigint(11), 12FWPBR bigint(11), AVLS bigint(11), TVmean60 bigint(11)
) ENGINE=InnoDB DEFAULT CHARSET=utf8
'''
cursor.execute(sql)
conn.commit()
finally:
conn.close()
댓글 입력