www.webdeveloper.com
Results 1 to 2 of 2

Thread: db connection problem

  1. #1
    Join Date
    Aug 2004
    Posts
    11

    db connection problem

    Hello all.
    In a jsp application, I´m trying to conect to the application´s db (MySQL) by:
    // jsp file
    <%
    YYY.Atividade atv;
    atv = new YYY.Atividade();
    atv.criaConexaoBD();
    %>
    // bean
    public void criaConexaoBD()throws ClassNotFoundException, IllegalAccessException,InstantiationException, SQLException
    {
    String driver = "com.mysql.jdbc.Driver";
    String url = "jdbc:mysql://130.1.1.130/mdb1";
    Class.forName(driver).newInstance();
    this.conexaoBanco = DriverManager.getConnection(url, "root", "");
    this.v_statement = this.conexaoBanco.createStatement();
    }

    I´m getting this server (Tomcat v. 5.0) message:

    ERRO :java.sql.SQLException: Invalid authorization specification, message from server: "Access denied for user: 'root'@'egdesenvolv.globoprdom.com.br' (Using password: NO)" .

    Even using a password or changing the user i´m getting the same trouble...I know that if i use
    url= "jdbc:mysql://localhost/mdb1";
    the connection work´s...

    Does somebody know´s what´s wrong?
    Thank´s for your attention,
    Rafael.

  2. #2
    Join Date
    Dec 2002
    Location
    Calgary, Canada
    Posts
    6,119
    try connecting to the MySQL using the same user name and password from the dos.
    My guess is that you will get the same "Access Denied" error.
    This typically means that your user name/password configuration is not correct.
    Cheers

    Khalid

    Message Posting Guidelines In These Forums, Please read these before posting any question.
    Web site: webapplikations.com
    Web Resources Page:Web Resources

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles