不写 database 参数就好了

import pymysql.cursors# Connect to the databaseconnection = pymysql.connect(host='192.168.31.xxx',                             user='root',                             password='xxx',                             )