# coding:utf-8
import MySQLdb
try:
conn = MySQLdb.connect(host='xxx',
user='xxx',
passwd='xxx',
db='xxx',
port=3306,
charset="utf8")
except MySQLdb.Error, e:
print 'MySQL Error %d:%s' % (e.args[0], e.args[1])
sql = """
CREATE TRIGGER xxx
AFTER UPDATE ON xxx
FOR EACH ROW
BEGIN
insert into xxx values ('test');
END
"""
cursor = conn.cursor()
print cursor.execute(sql)
python 创建触发器
最新推荐文章于 2022-05-16 18:44:14 发布