Python Forum

Full Version: Program stuck at mysql.connector.connect
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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?
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