# -*- coding:utf-8 -*-
__author__ = 'yangxin_ryan'
from sqlalchemy import create_engine
import pandas as pd
# MySQLUtil include:
# df_write_mysql -> DataFrame write into mysql xx database xx table function
class MySQLUtil:
# param:ip、port、username、password、database、tableName
def __init__(self, host, port, username, password, db, table):
self.host = host
self.port = port
self.username = username
self.password = password
self.db = db
self.table = table
self.write_mode = 'append'
self.connect_url = 'mysql+pymysql://' + username + ':' + password + '@' + host
Python实现将DataFrame写入Mysql
最新推荐文章于 2023-11-06 23:35:37 发布