Installation navicat for mysql, Reference: https://www.jianshu.com/p/2494e02caf63
pymysql Import
ECShop = pymysql.connect ( 'localhost', 'the root', 'the root', 'ECShop') # connect to the database
cus = ecshop.cursor () # Create a cursor object
cus.execute ( "SELECT VERSION ()" ) # sql query execution
#Print (dir (CuS))
DATAS = cus.fetchone () # get a single data
Print (DATAS)
ecshop.close () # close the database
#print (dir (ecshop))