Skip to content

Instantly share code, notes, and snippets.

View yogesh-aggarwal's full-sized avatar

Yogesh Aggarwal yogesh-aggarwal

View GitHub Profile
@yogesh-aggarwal
yogesh-aggarwal / MySQL.py
Created August 16, 2019 15:27
Basic MySQL-Python connector code to connect database.
import mysql.connector
db_connection = mysql.connector.connect(
host= "localhost",
user= "root",
passwd= "root"
)
# creating database_cursor to perform SQL operation
db_cursor = db_connection.cursor()
# executing cursor with execute method and pass SQL query
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.