Skip to content

Instantly share code, notes, and snippets.

@neilkod
Created June 16, 2010 14:59
Show Gist options
  • Save neilkod/440812 to your computer and use it in GitHub Desktop.
Save neilkod/440812 to your computer and use it in GitHub Desktop.
#!/usr/bin/python
import MySQLdb
conn = MySQLdb.connect (host = "localhost",user="root",db="test")
cursor = conn.cursor()
cursor.execute("SELECT VERSION()")
row = cursor.fetchone()
print "server version:", row[0]
cursor.close()
cursor=conn.cursor()
conn.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment