下面是我连接到服务器我的Java连接返回到服务器故障的连接
Class.forName("com.mysql.jdbc.Driver");
Connection conn = DriverManager.getConnection("jdbc:mysql://localhost:81/user", "root", "");
JOptionPane.showMessageDialog(null, "Connection Established");
return conn;
}catch (Exception e){
JOptionPane.showMessageDialog(null, e);
return null;
}
的实际连接可以在此行中找到:
DriverManager.getConnection("jdbc:mysql://localhost:81/user", "root", "");
正在使用端口81用于MySQL数据库因为80端口正在被另一个程序使用。
请帮我解决这个问题。并提前致谢。
显示消息&stacktrace,显示你的mysql服务器设置 - 这些都是必需品;否则,你会被分数 –