MySQL: [08S01] Communications link failure

12,203

Solution 1

I tried with no result. After all I restarted and it showed me error message with expired password (which was one from mysql, I never changed it). To change password I have to install MySQL workbench, change pass and now it works. Anyway thank you!

Solution 2

I ran into similar error when trying have JetBean Datagrip and Pycharm to connect to mySQL server hosted by Amazon.

I am able to fix this issue by using an earlier version of my SQL driver.

For example:

enter image description here

Solution 3

I simply changed the driver to Amazon Aurora MySQL despite having a simple mysql database on a VPS.

enter image description here

Share:
12,203
Beginner
Author by

Beginner

Java developer in and after work.

Updated on June 04, 2022

Comments

  • Beginner
    Beginner almost 2 years

    I have an application with local DB, which is H2. But customer is using MySQL. There were some issues on customer side, so I decided to install and run an application against MySQL on local machine (MacOS). I am using java 9.

    1. Download MySQL
    2. Install
    3. Follow very easy how to from jetbrains

    Current setup: enter image description here enter image description here

    After click on "Test Connection" I am getting following error.

    enter image description here

    There is a lot of comments:

    packet drops or badly configured Firewall/Switch

    a lot of transaction

    known bug - solution in maven dependency

    But most of them are not in test connection, but in configuration. Also the connection for those guys works at least once or through another set of firewalls. None of the previous solutions fit my case.

    I also try to restart MySQL with:

    sudo service mysql restart
    

    With the result:

    service: command not found
    

    Or just to check the status with:

    sudo service mysql status
    

    With the result:

    service: command not found
    

    I dont know if it is connected to my issue? Is db running "forever" or idea will run it only when I will run the app? Could anyone help with connection to db?

    • Jay Shankar Gupta
      Jay Shankar Gupta about 6 years
      sudo mysql -root -p restart try this one
    • Beginner
      Beginner about 6 years
      With result: sudo: mysql: command not found
    • Jay Shankar Gupta
      Jay Shankar Gupta about 6 years
    • Beginner
      Beginner about 6 years
      I tried with no result. After all I restarted and it showed me error message with expired password (which was one from mysql, I never changed it). To change password I have to install MySQL workbench, change pass and now it works. Anyway thank you!