I am using FreeBSD 9.2 and mysql 5.5 and i am using SOMETIMES this error - * Lost connection to MySQL server at 'reading initial communication packet', system error: 0* when i am executing sql commands from outside (localhost works fine). I have been googling almost whole day. .... I have tryed:

mysqld : ALL : allow -> hosts.allow

bind-address with-my-live-server-ip -> my.cnf

commenting bind-address in my.cnf

and allowingtcpforwarding in sshd_config

help me please...

  • and i am not using any firewall
    – vldermdd4
    Aug 21 '15 at 19:43
  • Since you are not using a firewall please include that information in the question, rather than as a comment. Additionally, provide the contents your my.cnf configuration. Take a look at dmesg and your server logs to see if anything of note is in there and include that in your question as well.
    – Gene
    Aug 21 '15 at 19:50
  • Regarding this statement: "and allowingtcpforwarding in sshd_config". Are you tunneling your mysql connection through SSH? If so please provide the steps you're using to do this.
    – Gene
    Aug 21 '15 at 19:52
  • Increase connect_timeout global variable.
    – Navern
    Aug 21 '15 at 22:17

Run the command show global status;, look for the Aborted_connections and Threads_created, if both values are high increase the thread_cache_size variable.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.