Run »
import mysql.connector mydb = mysql.connector.connect( host="localhost", user="myusername", password="mypassword", database="mydatabase" ) mycursor = mydb.cursor() mycursor.execute("SELECT * FROM customers") myresult = mycursor.fetchone() print(myresult)
(1, 'John', 'Highway 21')