Java 8 0 25 SQL MySQL Connector

Feedback


Solution 1:

Find the my.cnf file and add a comment to the specified line.

skip-networking

to

#skip-networking

Restart mysql


Solution 2:

Try to specify the port in

conn = DriverManager.getConnection("jdbc:mysql://localhost/mysql?"
                                        + "user=root&password=onelife");

I believe it would be beneficial for you to have a similar item as this.

conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/mysql?"
                                            + "user=root&password=onelife");

In my example, the port number (3306) is the default one for MySQL installation, but you have the option to modify it.

I believe that a more effective approach to defining the password and user is to detach them from the URL in the following manner:

connection = DriverManager.getConnection(url, login, password);


Solution 3:


The problem has been resolved using updated mysql connectors. Kindly refer to http://mvnrepository.com/artifact/mysql/mysql-connector-java/5.1.38 for usage.

After updating the connector jar, I no longer encountered this error.

Frequently Asked Questions