标签:mysq host sql cursor 必须 info base bsp utf-8
db_info = {‘user‘: ‘root‘,
‘password‘: ‘123456‘,
‘host‘: ‘localhost‘,
‘port‘: 3306,
‘database‘: ‘test‘
}
‘mysql+pymysql://%(user)s:%(password)s@%(host)s:%(port)d/%(database)s?charset=utf8‘ % db_info, encoding=‘utf-8‘
‘mysql+pymysql://root:123456@localhost:3306/test‘, encoding=‘utf-8‘
用pymysql,则必须用cursor
conn = pymysql.connect(host=‘127.0.0.1‘, port=3306, user=‘root‘, passwd=‘123456‘, db=‘test‘) # engine = create_engine(‘mysql+pymysql://root:123456@localhost:3306/test‘)
完整版参考:https://www.cnblogs.com/fuqia/p/8996033.html
标签:mysq host sql cursor 必须 info base bsp utf-8
原文地址:https://www.cnblogs.com/hightech/p/14743805.html