#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2002
    Posts
    0
    Rep Power
    0

    Access denied to mySQL database


    I have a newly setup mySQL database where I'm trying to get a basic connection going. However, I've tried numerous attempts changing usernames and passwords but it won't let my login via my jsp page. I can login if I launch the mysql.exe from my dos prompt.

    I am getting this error when the jsp page is loaded:

    Driver Loaded!
    SQLException: Invalid authorization specification: Access denied for user: 'test@192.168.1.1' (Using password: YES)



    Here's a code snippet:
    public String connect() {
    try {

    Class.forName("org.gjt.mm.mysql.Driver").newInstance();
    return "Driver Loaded!";
    } catch (Exception E) {
    return "Unable to load driver.";
    }
    }

    public String select() {
    try {
    String user = "test", password = "test";
    Connection C = DriverManager.getConnection("jdbc:mysql://141.154.254.162:3306/" + user + "?user=" + user + "&password=" + password );

    Everything looks like it is setup correctly, If anyone has any idea how I can resolve this or aid in a step in resolving this, would be greatly appreciated!!

    -Brian
  2. #2
  3. Modding: Oracle MsSQL Firebird
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jun 2001
    Location
    Outside US
    Posts
    8,527
    Rep Power
    539

IMN logo majestic logo threadwatch logo seochat tools logo