Pymysql Insert Into not working

前端 未结 3 1889
感动是毒
感动是毒 2020-12-15 02:43

I\'m running this from PyDev in Eclipse...

import pymysql
conn = pymysql.connect(host=\'localhost\', port=3306, user=\'userid\', passwd=\'password\', db=\'fa         


        
3条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-15 02:50

    You can either do

    • conn.commit() before calling close

    or

    • enable autocommit via conn.autocommit(True) right after creating the connection object.

    Both ways have been suggested from various people at a duplication of the question that can be found here: Database does not update automatically with MySQL and Python

提交回复
热议问题