I would like to extract an ip address from mysql using python.
here is my code,
cnx = mysql.connector.connect(host=mysql_localhost, user=user, password=password, database=database)
cursor = cnx.cursor()
cursor.execute("select inet_ntoa(server) as ip from settings" )
#print 'Data inserted into Database'
results = cursor.fetchone()
print(results)
cursor.close()
cnx.close()
and my result is
('192.168.0.15',)
how can i save the result above to an ip address?