Dec-20-2023, 04:06 PM
I have a script that uses a Virtual Environment and has a connection to mysql where the connection string has the host as localhost or 127.0.0.1, it works without the virtual environment, however, when i run it in the venv, it changes the host to 172.18.0.1, why does that happen?
with mysql.connector.connect(**mysql_webserver_connection, charset="utf8") as conn: with conn.cursor(dictionary=True) as cursor: cursor.execute(query_string) results = cursor.fetchall()