1

I am trying to connect a connector/j driver to Netbeans.

I am following below steps to connect,

  1. In services I right click and click new connection.
  2. then I browse and add mysql-connector-java-5.1.23-bin.jar file .
  3. Then click next.
  4. Then comes a JDBC url : jdbc:mysql://localhost:3306/mysql is showing.
  5. I click the test connection button

Then I get the following error:

Cannot establish a connection to jdbc:mysql://localhost:3306/mysql using com.mysql.jdbc. Driver (Communications link failure The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.)

John Hascall
  • 9,176
  • 6
  • 48
  • 72
user5809644
  • 27
  • 2
  • 4
  • 14

2 Answers2

1

I've personally had this problem too. Netbeans sometimes has problems dealing with MySQL. I would suggest you download MySQL Community Server and MySQL Workbench and use those to run your database. It's much more efficient and gives you more control over your database.

  • thanks for your reply it is working – user5809644 Jan 22 '16 at 12:22
  • I also in same problem but I can connect using the workbench and mysql administrator. But mysql connection using netbeans is faild and It is same for the compiled and maked EXE files I am using windows 10 OS [![enter image [![enter image description here][1]][1] [![enter image description here][2]][2] [1]: http://i.stack.imgur.com/3Jlw4.png [2]: http://i.stack.imgur.com/GUCx3.png – Thilina Dharmasena Jul 28 '16 at 10:37
0

I get this types of error and I have fixed as follows first open /etc/my.cnf file and comment

# skip-networking 

and check where is bind-adress if not add the following

bind-address            = 127.0.0.1
bind-address            = your ip address
tima
  • 1,498
  • 4
  • 20
  • 28
Kelemu
  • 31
  • 1