你先试一下navicat能不能和本地数据库连接conn=pymysql.connect(host="localhost",port=3306,user="root",password='123456',db='douban')