Skip to content

Instantly share code, notes, and snippets.

@anubhavsinha
Created March 28, 2017 17:29
Show Gist options
  • Save anubhavsinha/6605030871dece66bc25808bfa1253f5 to your computer and use it in GitHub Desktop.
Save anubhavsinha/6605030871dece66bc25808bfa1253f5 to your computer and use it in GitHub Desktop.
mysql python connection
import MySQLdb
connection = MySQLdb.connect (host = db_host, user = "yaacdev" , passwd = "yaacmydev", db = "mintshowapp_live")
cursor = connection.cursor (MySQLdb.cursors.DictCursor)
query='sql query'
cursor.execute (query)
data = cursor.fetchall()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment