I\'m running this from PyDev in Eclipse...
import pymysql
conn = pymysql.connect(host=\'localhost\', port=3306, user=\'userid\', passwd=\'password\', db=\'fa
You can either do
conn.commit()
before calling close
or
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
Did you commit it? conn.commit()
PyMySQL disable autocommit
by default, you can add autocommit=True
to connect()
:
conn = pymysql.connect(
host='localhost',
user='user',
passwd='passwd',
db='db',
autocommit=True
)
or call conn.commit()
after insert