Python Forum
Program stuck at mysql.connector.connect - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: Program stuck at mysql.connector.connect (/thread-34413.html)



Program stuck at mysql.connector.connect but works on browser - zazas321 - Jul-29-2021

Hello. I have Raspberry PI 4 and have been using MYSQL on it for a while without any issues. I have decided to dedicate a standalone linux server just to handle my services and seperate them from my Raspberry PI 4. I have installed all the required modules on my linux server to install mysql, apach2 and phpmyadmin and I can access phpmyadmin on the Raspberry PI 4 browser without any issues using the IP of the server: 192.168.3.146/phpmyadmin.

However, when trying to access the mysql DB from python, it is getting stuck at mysql.connector.connect :

print("trying MYSQL")
myConnection = mysql.connector.connect(host=192.168.3.146, user='test_user', passwd='test_user123', db='test', autocommit=True)
print("Connection ID:", myConnection)
print(myConnection)
2 print statements after myConnection never gets executed which tells me that program is stuck at there. How can this be possible if I can reach that through the browser without any issues?


Program stuck at mysql.connector.connect - zazas321 - Jul-29-2021

Hello. I have Raspberry PI 4 and have been using MYSQL on it for a while without any issues. I have decided to dedicate a standalone linux server just to handle my services and seperate them from my Raspberry PI 4. I have installed all the required modules on my linux server to install mysql, apach2 and phpmyadmin and I can access phpmyadmin on the Raspberry PI 4 browser without any issues using the IP of the server: 192.168.3.146/phpmyadmin.

However, when trying to access the mysql DB from python, it is getting stuck at mysql.connector.connect :

print("trying MYSQL")
myConnection = mysql.connector.connect(host=192.168.3.146, user='test_user', passwd='test_user123', db='test', autocommit=True)
print("Connection ID:", myConnection)
print(myConnection)
2 print statements after myConnection never gets executed which tells me that program is stuck at there. How can this be possible if I can reach that through the browser without any issues?


The phpmyadmin screen on the browser looks as following:
https://ibb.co/kJmrX6Q