Discussion:
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
janpihlgren
2008-11-21 07:39:20 UTC
Permalink
Just installed NetBeans 6.5 and now try to run som javaprogram that require
connection to a MySQL-database.
I get this errormessage:
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link
failure
and a point to these rows int the program:
String _url = "jdbc:mysql://localhost:3306/" +database;
Connection conn = DriverManager.getConnection(_url, user, pwd);

I also have these lines before:
try{
Class.forName("com.mysql.jdbc.Driver");
}

In the Library I use this:
MySQLJDBC Driver - mysql-connector-java-5.1.6-bin.jar

Before using NetBeans 6.5 I use 6.1 and MySQLJDBC Driver -
mysql-connector-java-5.1.5-bin.jar and i worked.

My question is what to do?
--
View this message in context: http://www.nabble.com/com.mysql.jdbc.exceptions.jdbc4.CommunicationsException%3A-Communications-link-failure-tp20616473p20616473.html
Sent from the Netbeans IDE Users mailing list archive at Nabble.com.
Futaleufu_John
2008-11-21 13:01:30 UTC
Permalink
It sounds like MySQL server isn't running.

If you are using Windows, make sure mysqld-nt.exe is running. You can use
Task Manager to see if the service is running and Control Panel's
Administrative Tools|Services dialog to start the service if it is not. On
my computer the service name is MySQL.
Post by janpihlgren
Just installed NetBeans 6.5 and now try to run som javaprogram that
require connection to a MySQL-database.
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications
link failure
String _url = "jdbc:mysql://localhost:3306/" +database;
Connection conn = DriverManager.getConnection(_url, user, pwd);
--
View this message in context: http://www.nabble.com/com.mysql.jdbc.exceptions.jdbc4.CommunicationsException%3A-Communications-link-failure-tp20616473p20620587.html
Sent from the Netbeans IDE Users mailing list archive at Nabble.com.
janpihlgren
2008-11-21 13:21:43 UTC
Permalink
I'm using Mandriva Linux 2009.0
MySQL server is up and running. I can access it through other programs as
mysql, /usr/bin/mysql-administrator.
So that's not the problem.
Post by Futaleufu_John
It sounds like MySQL server isn't running.
If you are using Windows, make sure mysqld-nt.exe is running. You can use
Task Manager to see if the service is running and Control Panel's
Administrative Tools|Services dialog to start the service if it is not. On
my computer the service name is MySQL.
Post by janpihlgren
Just installed NetBeans 6.5 and now try to run som javaprogram that
require connection to a MySQL-database.
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications
link failure
String _url = "jdbc:mysql://localhost:3306/" +database;
Connection conn = DriverManager.getConnection(_url, user, pwd);
--
View this message in context: http://www.nabble.com/com.mysql.jdbc.exceptions.jdbc4.CommunicationsException%3A-Communications-link-failure-tp20616473p20620907.html
Sent from the Netbeans IDE Users mailing list archive at Nabble.com.
Omar Vazquez
2008-11-21 15:25:53 UTC
Permalink
I have the same error in some app. after searching in google i found that
this error coud be arraised because of the transactions. that means, when a
transaction in not roll-back after an exception the conecction is broken (or
something like that) and start that message.
Try to check the transactions in your app. to verify if they are closing
properly.
Post by janpihlgren
I'm using Mandriva Linux 2009.0
MySQL server is up and running. I can access it through other programs as
mysql, /usr/bin/mysql-administrator.
So that's not the problem.
Post by Futaleufu_John
It sounds like MySQL server isn't running.
If you are using Windows, make sure mysqld-nt.exe is running. You can use
Task Manager to see if the service is running and Control Panel's
Administrative Tools|Services dialog to start the service if it is not.
On
Post by Futaleufu_John
my computer the service name is MySQL.
Post by janpihlgren
Just installed NetBeans 6.5 and now try to run som javaprogram that
require connection to a MySQL-database.
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications
link failure
String _url = "jdbc:mysql://localhost:3306/" +database;
Connection conn = DriverManager.getConnection(_url, user, pwd);
--
http://www.nabble.com/com.mysql.jdbc.exceptions.jdbc4.CommunicationsException%3A-Communications-link-failure-tp20616473p20620907.html
Sent from the Netbeans IDE Users mailing list archive at Nabble.com.
--
OJVM
janpihlgren
2008-11-21 19:17:26 UTC
Permalink
I solved the problem.
I have change OS and have forgotten to chandge the mysql varable
skip-networking.
When i did that everything works as expected. :-D
Thanks for trying to help.
Post by Omar Vazquez
I have the same error in some app. after searching in google i found that
this error coud be arraised because of the transactions. that means, when a
transaction in not roll-back after an exception the conecction is broken (or
something like that) and start that message.
Try to check the transactions in your app. to verify if they are closing
properly.
Post by janpihlgren
I'm using Mandriva Linux 2009.0
MySQL server is up and running. I can access it through other programs as
mysql, /usr/bin/mysql-administrator.
So that's not the problem.
Post by Futaleufu_John
It sounds like MySQL server isn't running.
If you are using Windows, make sure mysqld-nt.exe is running. You can
use
Post by Futaleufu_John
Task Manager to see if the service is running and Control Panel's
Administrative Tools|Services dialog to start the service if it is not.
On
Post by Futaleufu_John
my computer the service name is MySQL.
Post by janpihlgren
Just installed NetBeans 6.5 and now try to run som javaprogram that
require connection to a MySQL-database.
Communications
Post by Futaleufu_John
Post by janpihlgren
link failure
String _url = "jdbc:mysql://localhost:3306/" +database;
Connection conn = DriverManager.getConnection(_url, user,
pwd);
--
http://www.nabble.com/com.mysql.jdbc.exceptions.jdbc4.CommunicationsException%3A-Communications-link-failure-tp20616473p20620907.html
Sent from the Netbeans IDE Users mailing list archive at Nabble.com.
--
OJVM
--
View this message in context: http://www.nabble.com/com.mysql.jdbc.exceptions.jdbc4.CommunicationsException%3A-Communications-link-failure-tp20616473p20627870.html
Sent from the Netbeans IDE Users mailing list archive at Nabble.com.
Senfer
2009-07-10 00:18:56 UTC
Permalink
In Windows:

Goto <xampp-folder>\mysql\bin\

Open my.ini and search for "skip-federated". Comment it out (with a "#"
before "skip-federated"). Now it should work.
Post by janpihlgren
I solved the problem.
I have change OS and have forgotten to chandge the mysql varable
skip-networking.
When i did that everything works as expected. :-D
Thanks for trying to help.
Post by Omar Vazquez
I have the same error in some app. after searching in google i found that
this error coud be arraised because of the transactions. that means, when a
transaction in not roll-back after an exception the conecction is broken (or
something like that) and start that message.
Try to check the transactions in your app. to verify if they are closing
properly.
Post by janpihlgren
I'm using Mandriva Linux 2009.0
MySQL server is up and running. I can access it through other programs as
mysql, /usr/bin/mysql-administrator.
So that's not the problem.
Post by Futaleufu_John
It sounds like MySQL server isn't running.
If you are using Windows, make sure mysqld-nt.exe is running. You can
use
Post by Futaleufu_John
Task Manager to see if the service is running and Control Panel's
Administrative Tools|Services dialog to start the service if it is
not.
On
Post by Futaleufu_John
my computer the service name is MySQL.
Post by janpihlgren
Just installed NetBeans 6.5 and now try to run som javaprogram that
require connection to a MySQL-database.
Communications
Post by Futaleufu_John
Post by janpihlgren
link failure
String _url = "jdbc:mysql://localhost:3306/" +database;
Connection conn = DriverManager.getConnection(_url, user,
pwd);
--
http://www.nabble.com/com.mysql.jdbc.exceptions.jdbc4.CommunicationsException%3A-Communications-link-failure-tp20616473p20620907.html
Sent from the Netbeans IDE Users mailing list archive at Nabble.com.
--
OJVM
--
View this message in context: http://www.nabble.com/com.mysql.jdbc.exceptions.jdbc4.CommunicationsException%3A-Communications-link-failure-tp20616473p24419915.html
Sent from the Netbeans IDE Users mailing list archive at Nabble.com.
Plotinus
2008-11-23 19:36:11 UTC
Permalink
thanks, you helped me to find the solution! I was desperated :D
Loading...