pip install pymysql
connection = pymysql.connect(host='localhost', user='myuser', password='mypass', database='mydb') connection.close()