packet sequence number wrong - got 1 expected 0
Python에서 pymysql으로 MariaDB에 연결하는 코드를 작성하고 연결을 시도하는 순간 아래 에러와 함께 연결되지 않는다. ㅠㅠ packet sequence number wrong - got 1 expected 0 구글을 열심히 검색해보니 엉뚱한 내용이 나온다. 결국 찾은 원인은.... 계정이 localhost으로 생성되어 있었다. 전부 접속 가능하도록 변경하니 잘 접속된다. 저와 같은 삽질하는 분이 없길....
프로그래밍/Python
2022. 2. 15. 19:51
pymysql에서 blob column에 Insert하는 방법
import pymysql conn = pymysql.connect(host='host name or ip',user='user name',passwd='password',db='db name',charset='db의 charset') cur = conn.cursor() sql = 'insert into t1(c1,c2,c3) values(%s,%s,%s)' with open(filename, 'rb') as file: binaryData = file.read() #c1은 int, c2는 varchar(10), c3는 blob일 때 args = (1,'text',binaryData) cur.execute(sql,args) conn.commit() conn.close()
프로그래밍/Python
2022. 2. 15. 18:44
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- mediumblob
- F21VDU
- LG티비
- longblob
- F21VDZ
- F21VDD
- 고래문화마을
- libsystemd
- blob
- 최대 크기
- F21VDV
- pymysql
- OLED65B9
- OLED64B9CNA
- F21VBT
- F21VDT
- lgtv
- 캐시몽
- MariaDB
- max size
- 앱테크
- 헤이플
- Ubuntu 14.04
- OLED64B9BNA
- column 추가
- insert column
- F21VDN
- packet sequence number wrong
- OLED
- OLED65B9GNA
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | |||||
3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 25 | 26 | 27 | 28 | 29 | 30 |
31 |
글 보관함