LOFTER for ipad —— 让兴趣,更有趣

点击下载 关闭
随笔脚本
龙葵的库 2019-11-22

# -*- CODING:UTF-8 -*-
# Author  :'陈娟_Arwen',
# Date    :2019/11/14 16:12
# FileName:mysql
#IDE      :PyCharm
import pymysql.cursors
import md5
conn = pymysql.connect(
host='139.199.110.55',
port=3306,
user='root',
password='Rekoon@cn2018',
db='shop',
charset='utf8'
)
cursor = conn.cursor()
def eventId(deviceId):
ak = 0
sql = "SELECT id FROM ld_ad_match WHERE ld_ad_match.idfa = '%s' OR ld_ad_match.imei = '%s'"%(deviceId, deviceId)
    cursor.execute(sql)
    ak = cursor.fetchone()
return ak
def selects(deviceId):
    deviceIdMD5 = md5.md5_encrypt(deviceId)
    device_sql = "select * from ld_mobile_device_id where device_id LIKE '%s%s';" % (deviceId, "%")
    cursor.execute(device_sql)
print("ld_mobile_device_id表中删除的数据为:", cursor.fetchone())
    callback_sql = "SELECT * FROM ld_toutiao_callback WHERE idfa = '%s' or imei = '%s'" % (deviceIdMD5, deviceIdMD5)
    cursor.execute(callback_sql)
print("ld_toutiao_callback表中删除的数据为:", cursor.fetchone())
    request_sql = "SELECT * FROM ld_toutiao_request WHERE idfa = '%s' OR imei = '%s'" % (deviceIdMD5, deviceIdMD5)
    cursor.execute(request_sql)
print("ld_toutiao_request表中删除的数据为:", cursor.fetchone())
    event_sql = "SELECT id FROM ld_ad_match WHERE ld_ad_match.idfa = '%s' OR ld_ad_match.imei = '%s'" % (deviceIdMD5,
deviceIdMD5)
    cursor.execute(event_sql)
print("ld_ad_event表中删除的数据为:", cursor.fetchone())
    match_sql = "SELECT * FROM `ld_ad_match` WHERE imei = '%s' OR idfa = '%s'" % (deviceIdMD5, deviceIdMD5)
    cursor.execute(match_sql)
print("ld_ad_match表中删除的数据为:", cursor.fetchone())
def deletes (deviceId):
    deviceIdMD5 = md5.md5_encrypt(deviceId)
    deviceId1 =eventId(md5.md5_encrypt(deviceId))
if deviceId1 == None:
print("value为空")
else:
        event_sql = "DELETE FROM ld_ad_event WHERE ad_match_id = '%s'" % (deviceId1)
        cursor.execute(event_sql)
    device_sql = "delete from ld_mobile_device_id where device_id LIKE '%s%s';" % (deviceId, "%")
    callback_sql = "DELETE FROM ld_toutiao_callback WHERE idfa = '%s' or imei = '%s'" % (deviceIdMD5, deviceIdMD5)
request_sql = "DELETE FROM ld_toutiao_request WHERE idfa = '%s' OR imei = '%s'" % (deviceIdMD5, deviceIdMD5)
    request_sql = "DELETE FROM ld_ad_match WHERE idfa = '%s' OR imei = '%s'"%(deviceIdMD5, deviceIdMD5)
    cursor.execute(device_sql)
    cursor.execute(callback_sql)
    cursor.execute(request_sql)
    cursor.execute(request_sql)
print("删除成功!!!")
    conn.commit()
if __name__ == "__main__":
    deviceId = input("请输入要删除的 idfa 或者 imei :")
    selects(deviceId)
    deletes(deviceId)
    conn.close()

推荐文章
评论(0)
联系我们|招贤纳士|移动客户端|风格模板|官方博客|侵权投诉 Reporting Infringements|未成年人有害信息举报 0571-89852053|涉企举报专区
网易公司版权所有 ©1997-2024  浙公网安备 33010802010186号 浙ICP备16011220号-11 增值电信业务经营许可证:浙B2-20160599
网络文化经营许可证: 浙网文[2022]1208-054号 自营经营者信息 工业和信息化部备案管理系统网站 12318全国文化市场举报网站
网信算备330108093980202220015号 网信算备330108093980204230011号
分享到
转载我的主页