import mysql.connector
config = {
'host': 'localhost',
'user': 'your_username',
'password': 'your_password',
'database': 'your_database'
}
cnx = mysql.connector.connect(**config)
cursor = cnx.cursor()
query = "SELECT * FROM your_table"
cursor.execute(query)
result = cursor.fetchall()
cursor.close()
cnx.close()
print(result)
Bir yanıt yazın