import pandas as pd
# from pandas import DataFrame as df
import pymysql
import redis

cnx = pymysql.connect(host='114.116.44.11', user='caiji', password='f7s0&7qqtK', db='clb_project', charset='utf8mb4')
r = redis.Redis(host="114.115.236.206", port=6379, password='clbzzsn', db=6)
import urllib3
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
with cnx.cursor() as cursor:
    select = """select relationName, relationId from klb_company"""
    cursor.execute(select)
    results = cursor.fetchall()
    for result in results:
        name = result[0]
        xydm = result[1]
        item = f'{name}|{xydm}'
        r.rpush('SousuoBaidu:companyname', cell_value)

