python mysql database connection error

VasaraBharat

I am trying to access the remote database from one Linux server to another which is connected via LAN.

but it is not working.. after some time it will generate an error

`_mysql_exceptions.OperationalError: (2003, "Can't connect to MySQL server on '192.168.0.101' (99)")'

this error is random it will raise any time. each time create a new db object in all methods. and close the connection as well then also why this error raise. can any one please help me to sort out this problem

VasaraBharat

This issue is due to so many pending request on the remote database.

So in this situation MySql closes the connection to the running script.

to overcome this situation put

time.sleep(sec) # here int is a seconds in number that to sleep the script.

it will solve this issue.. without transferring database to local server or any other administrative task on mysql

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related