![]() |
connect to remote database via python script - 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: connect to remote database via python script (/thread-9679.html) |
connect to remote database via python script - sunstar20 - Apr-23-2018 Hi, I am able to connect to local database via python script. For ex: MySQLdb.connect("localhost","testuser","test123","test" ) I want to connect to remote database via python script. Could you please help. RE: connect to remote database via python script - Gribouillis - Apr-23-2018 You can probably replace the "localhost" by the host's IP address such as "127.0.0.1"
RE: connect to remote database via python script - sunstar20 - Apr-23-2018 Getting the below error: # python test.py Are there any other settings required for binding the remote ip of the remote database
RE: connect to remote database via python script - Gribouillis - Apr-23-2018 Is your server's IP address '1.2.3.4' ? Try to connect to the mysql server out of python (such as with the mysql command in a terminal). RE: connect to remote database via python script - sunstar20 - Apr-23-2018 current system ip for example: x.y.z.k I am trying to connect to the remote database of the remote server i.e 1.2.3.4 connecting to 1.2.3.4 from x.y.z.k
RE: connect to remote database via python script - Gribouillis - Apr-23-2018 Did you check the troubleshooting page? |