Created
March 28, 2017 17:29
-
-
Save anubhavsinha/6605030871dece66bc25808bfa1253f5 to your computer and use it in GitHub Desktop.
mysql python connection
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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