기계는 거짓말하지 않는다

Python pymysql cursor DB 값 변경 인식 불가 본문

Python

Python pymysql cursor DB 값 변경 인식 불가

KillinTime 2023. 4. 1. 00:13

pymysql connect의 cursor sql 실행 후 변경된 DB 값을 commit 함수를 호출해도 인식하지 못하는 경우가 있다.

commit 위치가 잘못되었을 수 있고 자동 커밋을 원하면 매번 connect를 새로하는 대신

connect 매개변수에 autocommit=True를 추가한다.

conn = pymysql.connect(host='localhost', port=3306,
    user=user, passwd=passwd, db=db, charset='utf8', autocommit=True)

참고

Python MySQL not refreshing - Stack Overflow

 

Python MySQL not refreshing

I have two programs: One that fill and updates a database and another that selects info from the database every 10 seconds. I use Pymysql. When I update the database I commit the data, I can see ...

stackoverflow.com

python Mysql SELECT data not refreshed - Stack Overflow

 

python Mysql SELECT data not refreshed

Non-commercial, non-professional user, seeking advice for hobbyist project. I'm trying to pull data from one Pi, and scroll it on a second Pi. However, terminal is showing repeats of the data ini...

stackoverflow.com

 

Comments