Skip to content

Commit

Permalink
Create hello_world.py
Browse files Browse the repository at this point in the history
  • Loading branch information
ajeetraina authored Dec 1, 2023
1 parent d228ffb commit 2c5996a
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions solution/python-mysql/hello_world.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import mysql.connector

connection = mysql.connector.connect(
user='root', password='root', host='mysql', port="3306", database='db')
print("DB connected")

cursor = connection.cursor()
cursor.execute('Select * FROM students')
students = cursor.fetchall()
connection.close()

print(students)

0 comments on commit 2c5996a

Please sign in to comment.