错误:infoInvalid authorization specification: Access denied for user

06-05-22 chenliyo99
test.jsp错误:

JSP test successfulbefore get the connection1 database connection error error infoInvalid authorization specification: Access denied for user 'viwit2_test'@'circini.lunarpages.com' (using password: YES)

test.jsp

内容:

<%@ page import="java.sql.*"%>

<%@ page import="java.util.*"%>

<%

out.print("JSP test successful");

String driver = "org.gjt.mm.mysql.Driver";

//String url = "jdbc:mysql://www.viwit.com/viwit2_viwit";

String url = "jdbc:mysql://localhost:3306/viwit2_viwit";

String UserName = "viwit2_test";

String Password = "test";

Connection con=null;

ResultSet rs=null;

try

{

Class.forName("org.gjt.mm.mysql.Driver");

out.println("before get the connection1");

con = DriverManager.getConnection(url,UserName ,Password );

out.println("get the connection2");

}

catch(SQLException ex)

{

out.println("database connection error");

out.println("error info" +ex.getMessage());

}

%>

banq
2006-05-26 16:29
没有数据库访问权限,用户名和密码不对

猜你喜欢