【发布时间】:2013-03-26 04:47:33
【问题描述】:
我在指定路径时遇到问题(我在以下文件夹中有两个文件:cmets.frm 和 db.opt:C:\xampp\mysql\data\feedback)...我正在使用 XAMPP 和 mySQL。我不知道为什么我有一个错误?请看一下我的这部分代码:
public void readDataBase() throws Exception {
try {
// This will load the MySQL driver, each DB has its own driver
Class.forName("com.mysql.jdbc.Driver");
// Setup the connection with the DB
connect = DriverManager
.getConnection("jdbc:mysql://localhost//feedback"
+ "user=root&password=1234");
PS:我的 localhost 密码是 12345678
【问题讨论】:
-
连接字符串将是错误的,因为您将
user连接到feedback:jdbc:mysql://localhost//feedbackuser=root&password=1234。
标签: java mysql path xampp localhost