#清空临时数据表
import pymysql
pymysql.install_as_MySQLdb()
""" www.jjddlc.com"""
"""作者:Pgabc"""
def stock_tmp_clr(dbnm):
db = pymysql.connect(host='127.0.0.1', user='root', passwd='xxxxxxx', db=dbnm, charset='utf8')
cursor = db.cursor()
# 清空stock_tmp
try:
query = "truncate table stock_tmp"
cursor.execute(query)
db.commit()
print('stock_tmp原表已清空')
except Exception as aa:
print(aa)
print('无stock_tmp表!')
if __name__=='__main__':
dbnm = 'stock'
stock_tmp_clr(dbnm)
python 清空mysql临时数据表
最新推荐文章于 2024-10-24 09:12:57 发布