gpt4 book ai didi

java - 将 mysql 连接到 Java netbeans 时出错

转载 作者:行者123 更新时间:2023-11-29 11:45:58 24 4
gpt4 key购买 nike

我正在尝试连接 connector/j driverNetbeans

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

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

然后我收到以下错误:

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 并使用它们来运行您的数据库。它效率更高,并且可以让您更好地控制数据库。

关于java - 将 mysql 连接到 Java netbeans 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34938331/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com