Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
import mysql.connector
from mysql.connector import Error
try:
cnx = mysql.connector.connect(user='remote2', password='Pass@123#', host='192.168.1.77', database='world')
except Error as err:
print err
cursor = cnx.cursor()
query = "select * from city"
b = True
while b:
cursor.execute(query)
for a in cursor:
print a
cursor.close()
cnx.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.