From 1dcdfa9bc9b393fb81d7eff8f3c12237ea6ea01b Mon Sep 17 00:00:00 2001 From: Thomas Sundvoll Date: Wed, 12 Jun 2024 20:18:41 +0200 Subject: [PATCH] Upgrade mysqlclient to v2.2.4 --- pub-sub-stream/receiver.py | 10 +++++----- pub-sub-stream/requirements.txt | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pub-sub-stream/receiver.py b/pub-sub-stream/receiver.py index 7059730..5c1edbb 100644 --- a/pub-sub-stream/receiver.py +++ b/pub-sub-stream/receiver.py @@ -1,12 +1,12 @@ import json +import time from queue import Queue from threading import Thread -import time -import mysql.connector +import MySQLdb from model.biography import Biography -from streamchannel.streams import polling_consumer, cancellation_token +from streamchannel.streams import cancellation_token, polling_consumer def map_from_message(message_body: str) -> Biography: @@ -15,8 +15,8 @@ def map_from_message(message_body: str) -> Biography: def handle_message(bio: Biography) -> bool: - mydb = mysql.connector.connect( - host="localhost", + mydb = MySQLdb.connect( + host="localhost", # try host="127.0.0.1" if failing to connect to MySQL running in Docker user="root", password="root", database="Lookup" diff --git a/pub-sub-stream/requirements.txt b/pub-sub-stream/requirements.txt index 9ba7d48..8b7c3e4 100644 --- a/pub-sub-stream/requirements.txt +++ b/pub-sub-stream/requirements.txt @@ -1,2 +1,2 @@ confluent-kafka==2.3.0 -mysqlclient==2.2.1 +mysqlclient==2.2.4