Skip to content

Instantly share code, notes, and snippets.

@anderson-marin26
Created March 28, 2017 12:19
Show Gist options
  • Save anderson-marin26/342e66e339a185aba34c69f9677c9338 to your computer and use it in GitHub Desktop.
Save anderson-marin26/342e66e339a185aba34c69f9677c9338 to your computer and use it in GitHub Desktop.
import mysql.connector
cnx = mysql.connector.connect(user='root', password='canalwebx', host='127.0.0.1', database='test')
cursor = cnx.cursor()
query = ("SELECT * FROM test")
cursor.execute(query)
for result in cursor:
print(result)
cursor.close()
cnx.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment