MYSQL/JDBC issues Communication Link Failure (Fortify 19.1.0 SSC)

Good morning all,

I am trying to connect the SSC to my MYSQL database but I am having trouble with the JDBC part. I am sure that it has been configured properly (at least to my limited knowledge) and I am failing to connect to the database. I get an error stating "Cannot Create PoolableConnectionFactory: Communications Link Failure, driver has not received any packets in 0 ms." Can anyone assist me in fixing this issue? I had previously setup the SSC before and followed the same process and used the same files and I was successful but this time I'm getting the error stated above.

  • Verified Answer

    Did you check if your mysql instance is running?

    What happens if you try (from the terminal)

    mysql -u username -p

    You will be prompted for the password associated with the username. After you give the correct password does the mysql client connect?

     

    If yes then , are you using a connection string like 

    "jdbc:mysql://localhost:3306/DBname", "root", "root");

     If yes, the replace localhost here with your IP address and try.

  • I am able to connect to mysql through the terminal like normal (mysql -u username -p) with no problems.

    This is what I put in for my connection in Fortify: jdbc:mysql://localhost:8080/ssc?useUnicode=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=falseandServerTimezone=CST

    This was the solution that I used the first time I had set up Fortify and it was able to successfully connect to the database. I don't know why I'm having the issue now.

  • Can you try with IP address instead of localhost in your connection string 

    jdbc:mysql://<ip address>:8080/ssc?useUnicode=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=falseandServerTimezone=CST

  • When I tried it with the 8080 port I am still getting the same error. I tried to use the port for mysql 3306 as well but when I did that one it would automatically say that it wouldn't connect and give me errors about the timezone which shouldn't happen since the code I entered should force the CST timezone.

  • Hi,

    Maybe it's just a copy and paste error, but should the connection string be more like

     

    jdbc:mysql://DATABASE_SERVER_IP:DATABASE_SERVER_PORT/SSC_DATABASE_NAME?useUnicode=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&ServerTimezone=CST

    and not like

    jdbc:mysql://DATABASE_SERVER_IP:DATABASE_SERVER_PORT/SSC_DATABASE_NAME?useUnicode=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=falseandServerTimezone=CST

     

    Note the "&"-character between useLagacyDatetimeCode=false and ServerTimezone=CST

     

    Cheers,

    Martin


  •  wrote:

    Hi,

    Maybe it's just a copy and paste error, but should the connection string be more like

     

    jdbc:mysql://DATABASE_SERVER_IP:DATABASE_SERVER_PORT/SSC_DATABASE_NAME?useUnicode=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&ServerTimezone=CST

    and not like

    jdbc:mysql://DATABASE_SERVER_IP:DATABASE_SERVER_PORT/SSC_DATABASE_NAME?useUnicode=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=falseandServerTimezone=CST

     

    Note the "&"-character between useLagacyDatetimeCode=false and ServerTimezone=CST

     

    Cheers,

    Martin


    Thanks for pointing that out Martin, I'll have to update my guide but I am receiving the same error.

  • Hi,

    Okay. Could you please tell which version of MySQL Database Server you use and which MySQL jdbc driver?

     

    Are you running the SSC on the same host as the MySQL Database?If yes, and if you use the default settings, the beginning of the connection string should be like the following

    jdbc:mysql://localhost:3306/...

     

    Did you already created the database you want to connect to? And did you already perform the sql scripts shipped with SSC?

     

    Cheers,

    Martin

  • I'm using MYSQL 5.7 and using JDBC 5.1.44 I'm running SSC through tomcat which is on port 8080. I have already created the database as well as ran the sql scripts on said database.

  • Hi,

    Maybe check your my.conf of your MySQL database. Maybe you block something or used another port. It's a shot in the blue, but worth a look. 
    Also, could you provide the SQL-Statement which you used to create the database? Maybe there is a problem.

    Cheers,
    Martin

  • Thanks for this I was using the wrong port and my timezone was messed up. Once I got it fixed it solved the problem