mysql数据库在家里就是连不上,求救

fansy007 2004-11-21 12:33:46
Class.forName("org.gjt.mm.mysql.Driver");
Connection conn=DriverManager.getConnection("mysql");

死活连不上啊
...全文
191 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
sunatteda 2004-11-21
  • 打赏
  • 举报
回复
Connection conn=DriverManager.getConnection("mysql");
系统怎么找到mysql???
至少因该有servername:prot ,username ,password 吧!
longjing_g 2004-11-21
  • 打赏
  • 举报
回复
Connection conn=DriverManager.getConnection("mysql");
系统怎么找到mysql???
fansy007 2004-11-21
  • 打赏
  • 举报
回复
能说的具体点吗?
我在mySQl manage下可以打开的阿
zyg158 2004-11-21
  • 打赏
  • 举报
回复
Connection conn = DriverManager.getConnection("jdbc:mysql://127.0.0.1/database","root","");
这样子连接mysql可以吧
javafaq2004 2004-11-21
  • 打赏
  • 举报
回复
对检查一下数据源。

向楼上问声早上好。
panda00 2004-11-21
  • 打赏
  • 举报
回复
设立数据源
wanghui_00 2004-11-21
  • 打赏
  • 举报
回复
servername:prot i think it mybe "servername:port?user=,password="
fansy007 2004-11-21
  • 打赏
  • 举报
回复
急阿,自己顶
fansy007 2004-11-21
  • 打赏
  • 举报
回复
servername:prot怎么打
例如我的数据库在c:\mysql\data目录下,用tomcat,jsp文件在http://localhost:8080/chuech/ 下,这个servename:prot改怎么打?

81,092

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧