Results 1 to 2 of 2

Thread: java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES

  1. #1
    Join Date
    Aug 2008
    Posts
    109

    Default java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES

    When i try to deploy my spring portal app on jetspeed i get the above error.

    I'm able to login using the password which i specify in applicationCOntext.xml as well as database.properties file. But deployment failed several times with the following exception. Please help.

    Code:
    Caused by: java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES)
            at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1055)
            at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:956)
            at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3491)
            at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3423)
            at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:910)
            at com.mysql.jdbc.MysqlIO.secureAuth411(MysqlIO.java:3938)
            at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1273)
            at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2031)
            at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:718)
            at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:46)
            at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
            at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
            at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
            at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
            at com.mysql.jdbc.Util.handleNewInstance(Util.java:406)
            at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:302)
            at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:282)
            at org.apache.commons.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:38)
            at org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:294)
            at org.apache.commons.dbcp.BasicDataSource.validateConnectionFactory(BasicDataSource.java:1247)
            at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1221)
            ... 46 more

  2. #2
    Join Date
    Aug 2008
    Posts
    109

    Default

    I got this working by changing the password of my database to the root password of linux.

    I executed following sql statements in mysql:

    update user set PASSWORD=PASSWORD('mylinuxrootpwd') where user='root';

    GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED BY 'mylinuxrootpwd' WITH GRANT OPTION;

    FLUSH PRIVILEGES;

    Also, i cahnged the password in database.properties and applicationCOntext.xml.

    Just curious. Why it doesn't accept any other passwords other than my linux root password for database user root?

    Is there something basic funda that i need to understand.

    I'm not good in database. So, if anybody know how to change the root password of mysql and use that in spring as well, pls let me know.

    Thanks in advance.

Posting Permissions

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