Skip to content

Instantly share code, notes, and snippets.

@mansha99
Last active September 5, 2023 10:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mansha99/44f3fdc0ae37a1b282472f5fa15ff58b to your computer and use it in GitHub Desktop.
Save mansha99/44f3fdc0ae37a1b282472f5fa15ff58b to your computer and use it in GitHub Desktop.
Initializing SQLAchemy Session
from sqlalchemy import create_engine
from sqlalchemy.orm import Session
import pymysql
pymysql.install_as_MySQLdb() #MySQL specific
connectionString="mysql+mysqldb://root:India12#$@localhost/alchemydb2"
engine = create_engine(connectionString,echo=False)#echo True will print on screen
session = Session(engine)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment