gpt4 book ai didi

java - 从 Java 应用程序创建表时出错

转载 作者:行者123 更新时间:2023-11-30 00:46:12 25 4
gpt4 key购买 nike

我正在尝试在 MySQL 数据库上创建表,但是当我单击按钮执行时,我在 GUI 上收到以下错误;

com.mysql.jdbc.exception.jdbc4.CommunicationsException: Communications link failure

The last packet sent succesfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.

为什么会出现这个错误?

Pastebin 上的完整代码; http://pastebin.com/NEic9iP4

最佳答案

你的问题是这一行:

url = "dbc:mysql://buiud.com:3306/buiud458_androidhive";

将其更改为:

url = "jdbc:mysql://buiud.com:3306/buiud458_androidhive";

当Mysql服务没有启动时也会出现该错误。但对于你来说,我认为错误在于你的网址

关于java - 从 Java 应用程序创建表时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21346953/

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