📜  在 pandas 中使用 mysql 数据库 - SQL 代码示例

📅  最后修改于: 2022-03-11 15:05:23.432000             🧑  作者: Mango

代码示例1
Importing data from a MySQL database into a Pandas data frame including column names:-
import mysql.connector as sql.
import pandas as pd.
db_connection = sql.connect(host='hostname', database='db_name', user='username', password='password')
db_cursor = db_connection.cursor()
db_cursor.execute('SELECT * FROM table_name')