I used to have similar problem with mysql database. when I used with a windows server, I search and search but didn't find a solution on it, so what I did was to create a function that connect to the mysql db and call it any time I want to make a query to the dp. That is how I solved my own
these is the example:
Then I do this whenever I want to make a query:
these is the example:
def connect_to_db(): # function connect to database return mysql.connector.connect(host="localhost", user="root", passwd="", database="lookup_bot")
Then I do this whenever I want to make a query:
mydp = connect_to_db() my_cursor = mydp.cursor(buffered=True)