List:MySQL and Java« Previous MessageNext Message »
From:Ijlal EL HAZITI Date:August 20 2012 12:40am
Subject:Access denied for user 'sa'@'localhost'
View as plain text  
Good evening

I'm trying to install a webapp: sakai, on a remote server; but I'm getting
that error:

Caused by: java.sql.SQLException: Access denied for user 'sa'@'localhost'
(using password: NO)
    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1074)
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4074)
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4006)
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:919)
    at com.mysql.jdbc.MysqlIO.secureAuth411(MysqlIO.java:4578)
    at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1296)
    at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2397)
    at
com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2430)
    at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2215)
    at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:813)
    at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:47)
    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:411)
    at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:399)
    at
com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:334)
    at
org.apache.commons.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:38)
    at
org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:294)
    at
org.apache.commons.pool.impl.GenericObjectPool.addObject(GenericObjectPool.java:1666)
    at
org.apache.commons.dbcp.SakaiBasicDataSource.createDataSource(SakaiBasicDataSource.java:246)
    ... 66 more

I'm using tomcat7, mysql 5.1, mysql-connector-java-5.1.21 and java 6_33.

tomcat instance starts fine.

before deploying sakai, there were no errors while starting or shutting
down tomcat.

I've already granted all privileges on the DB sakai to the user: sakai via
the command:

CREATE DATABASE sakai DEFAULT CHARACTER SET UTF8
GRANT ALL PRIVILEGES ON sakai.* to 'sakai'@localhost' identified by
'password'
FLUSH PRIVILEGES
QUIT

also; I have put the correct username and password in the sakai.properties
file, and removed the anonymous users also.
I appreciate your help.

Sincerely

Thread
Access denied for user 'sa'@'localhost'Ijlal EL HAZITI20 Aug
  • Re: Access denied for user 'sa'@'localhost'Jeff Newmiller20 Aug