# -*- coding: UTF-8 -*-
from os import listdir
import mysql.connector
#import pysftp
#cnopts = pysftp.CnOpts()
#cnopts.hostkeys = None
print('Work on python3')
mySQLconnection = mysql.connector.connect(host='localhost',database='mydatabase',user='root',password='password')
sql_select_Query = "select * from billing_servers WHERE `type`='system1'"
cursor = mySQLconnection .cursor()
cursor.execute(sql_select_Query)
records = cursor.fetchall()
for row in records:
print(row)
type
в таблице вторая, то print(row[1])
cursor = mySQLconnection.cursor(dictionary=True)
...
for row in records:
print(row['type'])