问题好象是你没有访问数据库的权限,你的MYSQL的ROOT用户的秘密是linux吗? 另一个可能是不能使用root用户进行非直接访问,你将ftpd的访问权给一个普通用户试试。 grant all on ftpd.* to ftpd identified by "ftpdpass"; 然后: con=DriverManager.getConnection"jdbc:mysql://localhost:3306/ftpd","ftpd","ftpdpass");
哦,应该是grant all on ftpd.* to ftpd@localhost identified by "ftpdpass";
另一个可能是不能使用root用户进行非直接访问,你将ftpd的访问权给一个普通用户试试。
grant all on ftpd.* to ftpd identified by "ftpdpass";
然后:
con=DriverManager.getConnection"jdbc:mysql://localhost:3306/ftpd","ftpd","ftpdpass");