From 2c5996adc292dd7c89220aee302c7417a9af794c Mon Sep 17 00:00:00 2001 From: "Ajeet Singh Raina, Docker Captain, ARM Innovator" Date: Fri, 1 Dec 2023 16:22:41 +0530 Subject: [PATCH] Create hello_world.py --- solution/python-mysql/hello_world.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 solution/python-mysql/hello_world.py diff --git a/solution/python-mysql/hello_world.py b/solution/python-mysql/hello_world.py new file mode 100644 index 000000000..e616f2a7c --- /dev/null +++ b/solution/python-mysql/hello_world.py @@ -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)