将mysql连接到Java netbeans时出错 [英] error when connecting mysql to Java netbeans

查看:145
本文介绍了将mysql连接到Java netbeans时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将connector/j driver连接到 Netbeans .

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

我正在按照以下步骤进行连接,

I am following below steps to connect,

  1. 在服务中,我右键单击并单击新连接.
  2. 然后浏览并添加mysql-connector-java-5.1.23-bin.jar文件.
  3. 然后单击下一步.
  4. 然后是JDBC url : jdbc:mysql://localhost:3306/mysql是 正在显示.
  5. 我点击测试连接按钮
  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

然后我得到以下错误:

无法建立连接 使用com.mysql.jdbc到jdbc:mysql://localhost:3306/mysql 驱动程序(通讯链接失败) 成功发送到服务器的最后一个数据包为0毫秒. 尚未从服务器接收到任何驱动程序包.)

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.)

推荐答案

我个人也遇到了这个问题. Netbeans有时在处理MySQL时遇到问题.我建议您下载MySQL Community Server和MySQL Workbench并使用它们来运行数据库.它效率更高,并且可以让您更好地控制数据库.

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.

这篇关于将mysql连接到Java netbeans时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆