php - Can't connect to MySQL server on 'IP' (4) -


The connection has already been done, but sometimes I cron job script

MySQL server can not connect to 'MaHost' (4)

My script was running for 3 months. I received the above response from yesterday. My script is working properly Sometimes the connection is successful, but sometimes it fails with the above response

Please tell the correct reason with the solution.

It may be time expired on connection.

Try expanding it with:

Also, try this code to check the connection time and if the time is ending. For {$ start = time ();

  ($ I = 0; $ i & lt; 100; $ i ++); // mysql connection // check connection and output success / error message $ end = time (); The resonance is "Time ended for connection $ i" ($ start $ end). "Seconds."; }  

Comments

Popular posts from this blog

Member with no value in F# -

java - Joda Time Interval Not returning what I expect -

c# - Showing a SelectedItem's Property -