Highlighted
USAFCIV2019 Frequent Contributor.
Frequent Contributor.
277 views

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

Jump to solution

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.

0 Likes
1 Solution

Accepted Solutions
Micro Focus Frequent Contributor
Micro Focus Frequent Contributor

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

Jump to solution

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.

0 Likes
11 Replies
Micro Focus Frequent Contributor
Micro Focus Frequent Contributor

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

Jump to solution

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.

0 Likes
USAFCIV2019 Frequent Contributor.
Frequent Contributor.

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

Jump to solution

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.

0 Likes
Micro Focus Frequent Contributor
Micro Focus Frequent Contributor

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

Jump to solution

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

0 Likes
USAFCIV2019 Frequent Contributor.
Frequent Contributor.

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

Jump to solution

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.

0 Likes
MHuschenbett Regular Contributor.
Regular Contributor.

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

Jump to solution

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

0 Likes
USAFCIV2019 Frequent Contributor.
Frequent Contributor.

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

Jump to solution

@MHuschenbett 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.

0 Likes
MHuschenbett Regular Contributor.
Regular Contributor.

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

Jump to solution

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

0 Likes
USAFCIV2019 Frequent Contributor.
Frequent Contributor.

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

Jump to solution

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.

0 Likes
MHuschenbett Regular Contributor.
Regular Contributor.

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

Jump to solution

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

0 Likes
USAFCIV2019 Frequent Contributor.
Frequent Contributor.

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

Jump to solution

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

0 Likes
USAFCIV2019 Frequent Contributor.
Frequent Contributor.

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

Jump to solution

Thanks it was the 3306 port I was supposed to be using. I don't know why I put 8080 in the guide.  I did some changes to the code to get rid of the timezone errors and now I'm able to connect to the database.

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.