import mysql.connector as sql import pandas as pd db_connection = sql.connect(host='hostname', database='db_name', user='username', password='password') df = pd.read_sql('SELECT * FROM table_name', con=db_connection)