下载mysql 5.1 和 gui tool,安装,之后用gui tool连接,一切非常顺利。
下载mysql-connector-java-5.1,按照里面的pdf文档所写的配置,顺利连上db:
Class.forName("com.mysql.jdbc.Driver").newInstance();
// 据文档上描述,newInstance()是为了work arround some errors
DriverManager.getConnection("jdbc:mysql://localhost/test", "root", "test1234");
// 注意 "mysql" 作为前缀,"test"是my sql的schema名称