python mysql select

Hello developers! In this post I have shared the details about “python mysql select”. Okay, let’s move on to the tutorial.

python mysql select

import mysql.connector
from sqlalchemy import create_engine
import pandas as pd

sqlEngine = create_engine('mysql+pymysql://username here:password here@localhost/db name')
dbConnection = sqlEngine.connect()
db = mysql.connector.connect(

    host="localhost",
    user="username...",
    passwd="password...",
    database="db name...")

mycursor = db.cursor()

statement = pd.read_sql("SELECT * FROM table", dbConnection)

# Get the returned values
print(statement.values)

Final Words

I hope this tutorial helps you to know about “python mysql select”. If you have any doubts regarding this post please let us know via the comment section. Share this post with your friends & family via social networks.

Hi, I'm Ranjith a full-time Blogger, YouTuber, Affiliate Marketer, & founder of Coder Diksha. Here, I post about programming to help developers.

Share on:

Leave a Comment