http://motionsharing.com/site/download/acefad55f1e81e456d71a7448b278915
无法从 Eclipse DataSource Explorer 连接到 MySQl 数据库。
我调整了合适的驱动程序,但我无法连接。 P.S.:我可以连接到 derby 数据库,也可以连接到 mysql 数据库,但只能通过代码连接,但我想从 Data Source Explorer 连接到 mysql 数据库以获得创建表等的可能性。
怎么了?
我可以通过代码连接。
public static void main(String args[]) {
try {
Class.forName("com.mysql.jdbc.Driver");
System.out.println("Driver loading success!");
String url = "jdbc:mysql://localhost:3306/mydb";
String name = "root";
String password = "root";
try {
Connection con = DriverManager.getConnection(url, name, password);
System.out.println("Connected.");
con.close();
System.out.println("Disconnected.");
} catch (SQLException e) {
e.printStackTrace();
}
} catch (ClassNotFoundException e) {
e.printStackTrace();
}
}
最佳答案
关于java - 无法从 Eclipse DataSource Explorer 连接到 MySQl 数据库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9421234/