Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

mysql connection with sqlalchecmy

import pandas as pd
import pymysql
from sqlalchemy import create_engine

cnx = create_engine('mysql+pymysql://<username>:<password>@<host>/<dbname>')    
df = pd.read_sql('SELECT * FROM <table_name>', cnx) #read the entire table
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #mysql #connection #sqlalchecmy
ADD COMMENT
Topic
Name
6+5 =