# -*- coding: utf-8 -*-
import MySQLdb
import time
import warnings
warnings.filterwarnings("ignore")
class ConnectMysql(object):
def __init__(self):
# 这里设置分页查询, 每页查询多少数据
self.page_size = 5000
def getTable(self):
conn = MySQLdb.connect(
host="***.***.**.**",
user="****",
passwd="*************",
db='****',
charset='utf8'
)
conn_local = MySQLdb.connect(
host="********************************",
user="**********",
passwd="********",
db='*******',
charset='utf8'
)
cur = conn.cursor()
cur_local = conn_local.cursor()
cur.execute('show tables')
tables = cur.fetchall()
for table in tables:
print str
python数据迁移
最新推荐文章于 2023-03-23 13:58:00 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)