In this article, I am connecting to MySql database.
I'm printing the data in the table to the console screen.
import mysql.connector
conn = mysql.connector.connect(
host="localhost",
database="book",
user="root",
password="1234" )
cursor = conn.cursor()
cursor.execute("Select * From worldclassics")
for row in cursor:
print(row)
Hope to see you in the next article. Happy coding.
No comments:
Post a Comment