0

I got this error when trying to connect to my MySql Server sitting on a new Server I opened, using MySql workbench.

Failed to connect to at :3306 mysql with user . lost connection to mysql server at reading initial communication packet, system error: 0

I see that this issue was spoken about a lot but I truly did not find an answer. Here is what I tried:

  • The iptables is not the problem since when testing via telnet 3306 I get a connection. Also I tried to connect when IpTables was turned off.
  • Erased the bind 0.0.0.0 from the my.cfd file. (As mentioned above I have a connection with my server with the 3306 port, so it couldn't be the problem)
  • Of course I did: CREATE USER 'developer'@'%' IDENTIFIED BY 'dev_password'; and GRANT ALL ON *.* TO 'developer'@'%';

I can't get what's the problem since there is a connection to my servers IP over this port, there for the problem should be somehow on the application level of mysql.

Even though this problem was talked about here here here etc. I would be very grateful for a direction for a solution. Also, I would be really happy if someone can explain the problem.

  • 1
    If it is NOT a live production server and you are aware of the consequences, given your mentioning it being a new CentOS server, you could check if SELinux might be causing the issue by temporariliy*** setting it to permissive (command line 'setenforce 0' is permissive, 'setenforce 1' is enforcing). *** Please never disable SELinux permanentely, posts mentioning otherwise always refer to the easy but enormously dangerous workaround, never to a safe solution. – cora Apr 9 at 20:01
  • @cora Thanks for your input. I tried it but it was unsuccessful :-( – Tomer Apr 12 at 5:18
0

Please check if there is any other kind of firewall between client and server, like ufw or security groups etc, looks like connection is okay but before making proper connection it's breaking, check response time for any manual queries on server of from other server.

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.