连接MySQL数据库(pymysql):
import pymysql
conn = pymysql.connect(host='地址',
port=3306,
user='账号',
passwd='密码',
charset='utf8'
)
#建立游标
cursor = conn.cursor()
#运行sql脚本
cursor.execute(sql)
连接到clikhouse
from clickhouse_driver import Client
host_name = '地址'
client = Client(host = host_name,
# database = '数据库',
user = '账号',
password = '密码',
port=9000)
client.execute(selsql)