Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am unable to connect to mysql cluster database after starting my management node, data node, mysql node. I made the necessary changes by adding the loadbalance in the dbURL. But I am not able to access the connection. The mysqld port is 1186. Please assist.

String dbURL = "jdbc:mysql:loadbalance://localhost/bank";
String dbDriver = "com.mysql.jdbc.Driver";
private Connection dbCon;
public boolean connect() throws ClassNotFoundException, SQLException {
        Class.forName(dbDriver);

        // login credentials to your MySQL server
        dbCon = DriverManager.getConnection(dbURL, "root", ""); 
        return true;
    }

The error I am getting when I try to log in is:

javax.servlet.ServletException: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

How do I test MySQL cluster database? I managed to login using the following in command prompt. Please assist.

mysql -h 127.0.0.1 -P5000 -u root

share|improve this question
    
I managed to connect. Require to change the port. –  dwyane johnson Mar 3 '12 at 3:42
    
Please provide an answer (rather than a comment) and when you can accept it. Thanks –  Iain Mar 3 '12 at 10:59
add comment

1 Answer

Required to change the port to resolve the issue.

String dbURL = "jdbc:mysql:loadbalance://localhost:3306/bank";

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.