import pymysql
#connection = pymysql.connect(host='127.0.0.1',port=3306,user='root',password='password',db='transfer_money',charset='utf-8')
config = {
'host':'127.0.0.1',
'port':3306,
'user':'root',
'password':'password',
'db':'transfer_money',
'charset':'utf8'
}
connection = pymysql.connect(**config)#创建连接
cursor = connection.cursor()#创建游标
print(connection,' ',cursor)
cursor.close()
connection.close()