Question: how to import data from excel to mysql using python?
Answer: import xlrd import MySQLdb # Open the workbook and define the worksheet book = xlrd. open_workbook("pytest. xls") sheet = book. sheet_by_name("source") # Establish a MySQL connection database = MySQLdb.