import pymysql con=pymysql.connect(host="localhost",user="root",password="888888") c=con.cursor() c.execute("show databases") r=c.fetchall() print(r)